Anonymous avatar Anonymous committed 26a3e45

Add the use_puppetagain_packages switch

Comments (0)

Files changed (2)

scripts/b2g_emulator_unittest.py

         {'regex': re.compile(r'''(Timeout|NoSuchAttribute|Javascript|NoSuchElement|XPathLookup|NoSuchWindow|StaleElement|ScriptTimeout|ElementNotVisible|NoSuchFrame|InvalidElementState|NoAlertPresent|InvalidCookieDomain|UnableToSetCookie|InvalidSelector|MoveTargetOutOfBounds)Exception'''), 'level': ERROR},
     ]
 
-    mozbase_dir = os.path.join('tests', 'mozbase')
-    virtualenv_modules = [
-        { 'manifestparser': os.path.join(mozbase_dir, 'manifestdestiny') },
-        { 'mozfile': os.path.join(mozbase_dir, 'mozfile') },
-        { 'mozhttpd': os.path.join(mozbase_dir, 'mozhttpd') },
-        { 'mozinfo': os.path.join(mozbase_dir, 'mozinfo') },
-        { 'mozinstall': os.path.join(mozbase_dir, 'mozinstall') },
-        { 'mozprofile': os.path.join(mozbase_dir, 'mozprofile') },
-        { 'mozprocess': os.path.join(mozbase_dir, 'mozprocess') },
-        { 'mozrunner': os.path.join(mozbase_dir, 'mozrunner') },
-        { 'mozdevice': os.path.join(mozbase_dir, 'mozdevice') },
-        { 'marionette': os.path.join('tests', 'marionette') },
-    ]
+    virtualenv_requirements = None
+    virtualenv_modules = None
 
     def __init__(self, require_config_file=False):
         super(B2GEmulatorTest, self).__init__(
                              'run-tests'],
             require_config_file=require_config_file,
             config={
-                'virtualenv_modules': self.virtualenv_modules,
                 'require_test_zip': True,
                 'emulator': 'arm',
                 # This is a special IP that has meaning to the emulator
         self.test_manifest = c.get('test_manifest')
         self.busybox_path = None
 
+        if c.get('use_puppetagain_packages'):
+            self.virtualenv_requirements = [
+                os.path.join('tests', 'b2g', 'b2g-unittest-requirements.txt')
+            ]
+            self.virtualenv_modules = [
+                'mozinstall',
+                { 'marionette': os.path.join('tests', 'marionette') },
+            ]
+        else:
+            mozbase_dir = os.path.join('tests', 'mozbase')
+            self.virtualenv_modules = [
+                { 'manifestparser': os.path.join(mozbase_dir, 'manifestdestiny') },
+                { 'mozfile': os.path.join(mozbase_dir, 'mozfile') },
+                { 'mozhttpd': os.path.join(mozbase_dir, 'mozhttpd') },
+                { 'mozinfo': os.path.join(mozbase_dir, 'mozinfo') },
+                { 'mozinstall': os.path.join(mozbase_dir, 'mozinstall') },
+                { 'moznetwork': os.path.join(mozbase_dir, 'moznetwork') },
+                { 'mozprofile': os.path.join(mozbase_dir, 'mozprofile') },
+                { 'mozprocess': os.path.join(mozbase_dir, 'mozprocess') },
+                { 'mozrunner': os.path.join(mozbase_dir, 'mozrunner') },
+                { 'mozdevice': os.path.join(mozbase_dir, 'mozdevice') },
+                { 'marionette': os.path.join('tests', 'marionette') },
+            ]
+
     # TODO detect required config items and fail if not set
 
     def query_abs_dirs(self):
                                parent_dir=dirs['abs_work_dir'])
             self.busybox_path = os.path.join(dirs['abs_work_dir'], 'busybox')
 
+    def create_virtualenv(self):
+        super(B2GEmulatorTest, self).__init__(modules=self.virtualenv_modules,
+                                              requirements=self.virtualenv_requirements)
+
     def _query_abs_base_cmd(self, suite):
         dirs = self.query_abs_dirs()
         cmd = [self.query_python_path('python')]

scripts/marionette.py

         {'regex': re.compile(r'''(Timeout|NoSuchAttribute|Javascript|NoSuchElement|XPathLookup|NoSuchWindow|StaleElement|ScriptTimeout|ElementNotVisible|NoSuchFrame|InvalidElementState|NoAlertPresent|InvalidCookieDomain|UnableToSetCookie|InvalidSelector|MoveTargetOutOfBounds)Exception'''), 'level': ERROR},
     ]
 
-    mozbase_dir = os.path.join('tests', 'mozbase')
-    virtualenv_modules = [
-        { 'manifestparser': os.path.join(mozbase_dir, 'manifestdestiny') },
-        { 'mozhttpd': os.path.join(mozbase_dir, 'mozhttpd') },
-        { 'mozinfo': os.path.join(mozbase_dir, 'mozinfo') },
-        { 'mozfile': os.path.join(mozbase_dir, 'mozfile') },
-        { 'mozinstall': os.path.join(mozbase_dir, 'mozinstall') },
-        { 'mozprofile': os.path.join(mozbase_dir, 'mozprofile') },
-        { 'mozprocess': os.path.join(mozbase_dir, 'mozprocess') },
-        { 'mozrunner': os.path.join(mozbase_dir, 'mozrunner') },
-        { 'mozdevice': os.path.join(mozbase_dir, 'mozdevice') },
-    ]
+    repos = []
 
-    repos = []
+    virtualenv_requirements = None
+    virtualenv_modules = None
 
     gaia_ui_tests_repo = {'repo': 'http://hg.mozilla.org/integration/gaia-ui-tests/',
                           'revision': 'default',
                              'install',
                              'run-marionette'],
             require_config_file=require_config_file,
-            config={'virtualenv_modules': self.virtualenv_modules,
-                    'require_test_zip': True,})
+            config={'require_test_zip': True,})
 
         # these are necessary since self.config is read only
         c = self.config
         self.installer_url = c.get('installer_url')
         self.installer_path = c.get('installer_path')
         self.binary_path = c.get('binary_path')
-        self.test_url = self.config.get('test_url')
+        self.test_url = c.get('test_url')
+
+        if c.get('use_puppetagain_packages'):
+            self.virtualenv_modules = [
+                'mozinstall',
+                { 'marionette': os.path.join('tests', 'marionette') },
+            ]
+        else:
+            mozbase_dir = os.path.join('tests', 'mozbase')
+            self.virtualenv_modules = [
+                { 'manifestparser': os.path.join(mozbase_dir, 'manifestdestiny') },
+                { 'mozhttpd': os.path.join(mozbase_dir, 'mozhttpd') },
+                { 'mozinfo': os.path.join(mozbase_dir, 'mozinfo') },
+                { 'mozfile': os.path.join(mozbase_dir, 'mozfile') },
+                { 'mozinstall': os.path.join(mozbase_dir, 'mozinstall') },
+                { 'moznetwork': os.path.join(mozbase_dir, 'moznetwork') },
+                { 'mozprofile': os.path.join(mozbase_dir, 'mozprofile') },
+                { 'mozprocess': os.path.join(mozbase_dir, 'mozprocess') },
+                { 'mozrunner': os.path.join(mozbase_dir, 'mozrunner') },
+                { 'mozdevice': os.path.join(mozbase_dir, 'mozdevice') },
+                { 'marionette': os.path.join('tests', 'marionette') },
+            ]
+
 
     def _pre_config_lock(self, rw_config):
         if not self.config.get('emulator') and not self.config.get('marionette_address'):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.