Bug 992983 - Follow up to fix treatment of preflight methods in desktop_unittest.py r=jlund
authorChris Manchester <cmanchester@mozilla.com>
Thu, 10 Sep 2015 10:33:27 -0700
changeset 294442 734229c5e1077333e978e6a8906b9fda8e81b85d
parent 294441 a08998668652dc3b24467bbcc2195fcafa798ad7
child 294443 2c9fe69fd9b485f3dd2118f04f56985d5f082b9f
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjlund
bugs992983
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 992983 - Follow up to fix treatment of preflight methods in desktop_unittest.py r=jlund
testing/mozharness/scripts/desktop_unittest.py
--- a/testing/mozharness/scripts/desktop_unittest.py
+++ b/testing/mozharness/scripts/desktop_unittest.py
@@ -493,34 +493,33 @@ class DesktopUnittest(TestingMixin, Merc
 
         # For mac these directories are in Contents/Resources, on other
         # platforms abs_res_dir will point to abs_app_dir.
         abs_res_dir = self.query_abs_res_dir()
         abs_res_components_dir = os.path.join(abs_res_dir, 'components')
         abs_res_plugins_dir = os.path.join(abs_res_dir, 'plugins')
         abs_res_extensions_dir = os.path.join(abs_res_dir, 'extensions')
 
-        if suites:  # there are xpcshell suites to run
-            self.mkdir_p(abs_res_plugins_dir)
-            self.info('copying %s to %s' % (os.path.join(dirs['abs_test_bin_dir'],
-                      c['xpcshell_name']), os.path.join(abs_app_dir,
-                                                        c['xpcshell_name'])))
-            shutil.copy2(os.path.join(dirs['abs_test_bin_dir'], c['xpcshell_name']),
-                         os.path.join(abs_app_dir, c['xpcshell_name']))
-            self.copytree(dirs['abs_test_bin_components_dir'],
-                          abs_res_components_dir,
+        self.mkdir_p(abs_res_plugins_dir)
+        self.info('copying %s to %s' % (os.path.join(dirs['abs_test_bin_dir'],
+                  c['xpcshell_name']), os.path.join(abs_app_dir,
+                                                    c['xpcshell_name'])))
+        shutil.copy2(os.path.join(dirs['abs_test_bin_dir'], c['xpcshell_name']),
+                     os.path.join(abs_app_dir, c['xpcshell_name']))
+        self.copytree(dirs['abs_test_bin_components_dir'],
+                      abs_res_components_dir,
+                      overwrite='overwrite_if_exists')
+        self.copytree(dirs['abs_test_bin_plugins_dir'],
+                      abs_res_plugins_dir,
+                      overwrite='overwrite_if_exists')
+        if os.path.isdir(dirs['abs_test_extensions_dir']):
+            self.mkdir_p(abs_res_extensions_dir)
+            self.copytree(dirs['abs_test_extensions_dir'],
+                          abs_res_extensions_dir,
                           overwrite='overwrite_if_exists')
-            self.copytree(dirs['abs_test_bin_plugins_dir'],
-                          abs_res_plugins_dir,
-                          overwrite='overwrite_if_exists')
-            if os.path.isdir(dirs['abs_test_extensions_dir']):
-                self.mkdir_p(abs_res_extensions_dir)
-                self.copytree(dirs['abs_test_extensions_dir'],
-                              abs_res_extensions_dir,
-                              overwrite='overwrite_if_exists')
 
     def preflight_cppunittest(self, suites):
         abs_res_dir = self.query_abs_res_dir()
         dirs = self.query_abs_dirs()
         abs_cppunittest_dir = dirs['abs_cppunittest_dir']
 
         # move manifest and js fils to resources dir, where tests expect them
         files = glob.glob(os.path.join(abs_cppunittest_dir, '*.js'))
@@ -544,42 +543,42 @@ class DesktopUnittest(TestingMixin, Merc
                       os.path.join(abs_app_dir))
 
     def preflight_mozmill(self, suites):
         c = self.config
         dirs = self.query_abs_dirs()
         abs_app_dir = self.query_abs_app_dir()
         abs_app_plugins_dir = os.path.join(abs_app_dir, 'plugins')
         abs_app_extensions_dir = os.path.join(abs_app_dir, 'extensions')
-        if suites:  # there are mozmill suites to run
-            self.mkdir_p(abs_app_plugins_dir)
-            self.copytree(dirs['abs_test_bin_plugins_dir'],
-                          abs_app_plugins_dir,
+
+        self.mkdir_p(abs_app_plugins_dir)
+        self.copytree(dirs['abs_test_bin_plugins_dir'],
+                      abs_app_plugins_dir,
+                      overwrite='overwrite_if_exists')
+        if os.path.isdir(dirs['abs_test_extensions_dir']):
+            self.copytree(dirs['abs_test_extensions_dir'],
+                          abs_app_extensions_dir,
                           overwrite='overwrite_if_exists')
-            if os.path.isdir(dirs['abs_test_extensions_dir']):
-                self.copytree(dirs['abs_test_extensions_dir'],
-                              abs_app_extensions_dir,
-                              overwrite='overwrite_if_exists')
-            modules = ['jsbridge', 'mozmill']
-            for module in modules:
-                self.install_module(module=os.path.join(dirs['abs_mozmill_dir'],
-                                                        'resources',
-                                                        module))
+        modules = ['jsbridge', 'mozmill']
+        for module in modules:
+            self.install_module(module=os.path.join(dirs['abs_mozmill_dir'],
+                                                    'resources',
+                                                    module))
 
     def _run_category_suites(self, suite_category, preflight_run_method=None):
         """run suite(s) to a specific category"""
         c = self.config
         dirs = self.query_abs_dirs()
         suites = self._query_specified_suites(suite_category)
         abs_app_dir = self.query_abs_app_dir()
         abs_res_dir = self.query_abs_res_dir()
 
-        if preflight_run_method:
-            preflight_run_method(suites)
         if suites:
+            if preflight_run_method:
+                preflight_run_method(suites)
             self.info('#### Running %s suites' % suite_category)
             for suite in suites:
                 abs_base_cmd = self._query_abs_base_cmd(suite_category, suite)
                 cmd = abs_base_cmd[:]
                 replace_dict = {
                     'abs_app_dir': abs_app_dir,
 
                     # Mac specific, but points to abs_app_dir on other