Bug 1238014 - Improve code of firefox-ui-tests module based on marionette.py. r=ahal a=testonly DONTBUILD
authorHenrik Skupin <mail@hskupin.info>
Thu, 21 Jan 2016 21:37:55 +0100
changeset 298440 ec2bd9b72622961153d7f3c4b3fd01dcad5b0295
parent 298439 468638b88f3cec55a7062412ff8d978b3de0dd2d
child 298441 882e6011c18f968f3e6993e4fac60c68ae6366a0
push id8951
push userhskupin@mozilla.com
push dateThu, 21 Jan 2016 20:42:49 +0000
treeherdermozilla-aurora@ec2bd9b72622 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal, testonly
bugs1238014
milestone45.0a2
Bug 1238014 - Improve code of firefox-ui-tests module based on marionette.py. r=ahal a=testonly DONTBUILD
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
testing/mozharness/scripts/firefox_ui_tests/update_release.py
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -117,18 +117,19 @@ class FirefoxUITests(TestingMixin, VCSTo
 
         super(FirefoxUITests, self).__init__(
             config_options=config_options,
             all_actions=all_actions or actions,
             default_actions=default_actions or actions,
             *args, **kwargs)
 
         # As long as we don't run on buildbot the following properties have be set on our own
+        self.binary_path = self.config.get('binary_path')
+        self.installer_path = self.config.get('installer_path')
         self.installer_url = self.config.get('installer_url')
-        self.installer_path = self.config.get('installer_path')
         self.test_packages_url = self.config.get('test_packages_url')
         self.test_url = self.config.get('test_url')
 
         self.reports = {'html': 'report.html', 'xunit': 'report.xml'}
 
         self.firefox_ui_repo = self.config['firefox_ui_repo']
         self.firefox_ui_branch = self.config.get('firefox_ui_branch')
 
@@ -162,18 +163,17 @@ class FirefoxUITests(TestingMixin, VCSTo
             self.register_virtualenv_module(requirements=[requirements])
 
     def checkout(self):
         """Clone the firefox-ui-tests repository."""
         dirs = self.query_abs_dirs()
 
         self.vcs_checkout(
             repo=self.firefox_ui_repo,
-            dest=dirs.get('abs_test_install_dir',
-                          os.path.join(dirs['abs_work_dir'], 'tests')),
+            dest=dirs['abs_test_install_dir'],
             branch=self.firefox_ui_branch,
             vcs='gittool',
             env=self.query_env(),
         )
 
     def clobber(self):
         """Delete the working directory"""
         super(FirefoxUITests, self).clobber()
@@ -210,20 +210,25 @@ class FirefoxUITests(TestingMixin, VCSTo
 
             if self.config.get('download_symbols'):
                 self._download_and_extract_symbols()
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
 
-        abs_dirs = VCSToolsScript.query_abs_dirs(self)
-        abs_dirs.update({
+        abs_dirs = super(FirefoxUITests, self).query_abs_dirs()
+        dirs = {
             'abs_reports_dir': os.path.join(abs_dirs['base_work_dir'], 'reports'),
-        })
+            'abs_test_install_dir': os.path.join(abs_dirs['abs_work_dir'], 'tests'),
+        }
+
+        for key in dirs.keys():
+            if key not in abs_dirs:
+                abs_dirs[key] = dirs[key]
         self.abs_dirs = abs_dirs
 
         return self.abs_dirs
 
     def query_harness_args(self, extra_harness_config_options=None):
         """Collects specific update test related command line arguments.
 
         Sub classes should override this method for their own specific arguments.
@@ -350,15 +355,17 @@ class FirefoxUIFunctionalTests(FirefoxUI
 
 class FirefoxUIUpdateTests(FirefoxUITests):
 
     cli_script = 'cli_update.py'
 
     def __init__(self, config_options=None, *args, **kwargs):
         config_options = config_options or firefox_ui_update_config_options
 
-        FirefoxUITests.__init__(self, config_options=config_options,
-                                *args, **kwargs)
+        super(FirefoxUIUpdateTests, self).__init__(
+            config_options=config_options,
+            *args, **kwargs
+        )
 
     def query_harness_args(self):
         """Collects specific update test related command line arguments."""
-        return FirefoxUITests.query_harness_args(self,
-                                                 firefox_ui_update_harness_config_options)
+        return super(FirefoxUIUpdateTests, self).query_harness_args(
+            firefox_ui_update_harness_config_options)
--- a/testing/mozharness/scripts/firefox_ui_tests/update_release.py
+++ b/testing/mozharness/scripts/firefox_ui_tests/update_release.py
@@ -68,20 +68,22 @@ class ReleaseFirefoxUIUpdateTests(Firefo
             'clobber',
             'checkout',
             'create-virtualenv',
             'query_minidump_stackwalk',
             'read-release-update-config',
             'run-tests',
         ]
 
-        FirefoxUIUpdateTests.__init__(self, all_actions=all_actions,
-                                      default_actions=all_actions,
-                                      config_options=firefox_ui_update_release_config_options,
-                                      append_env_variables_from_configs=True)
+        super(ReleaseFirefoxUIUpdateTests, self).__init__(
+            all_actions=all_actions,
+            default_actions=all_actions,
+            config_options=firefox_ui_update_release_config_options,
+            append_env_variables_from_configs=True,
+        )
 
         self.tools_repo = self.config.get('tools_repo')
         self.tools_tag = self.config.get('tools_tag')
 
         assert self.tools_repo and self.tools_tag, \
             'Without the "--tools-tag" we can\'t clone the releng\'s tools repository.'
 
         self.limit_locales = int(self.config.get('limit_locales'))
@@ -92,33 +94,37 @@ class ReleaseFirefoxUIUpdateTests(Firefo
 
     def checkout(self):
         """
         We checkout the tools repository and update to the right branch
         for it.
         """
         dirs = self.query_abs_dirs()
 
-        FirefoxUIUpdateTests.checkout(self)
+        super(ReleaseFirefoxUIUpdateTests, self).checkout()
 
         self.vcs_checkout(
             repo=self.tools_repo,
             dest=dirs['abs_tools_dir'],
             revision=self.tools_tag,
             vcs='hgtool'
         )
 
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
 
-        abs_dirs = FirefoxUIUpdateTests.query_abs_dirs(self)
-        abs_dirs.update({
+        abs_dirs = super(ReleaseFirefoxUIUpdateTests, self).query_abs_dirs()
+        dirs = {
             'abs_tools_dir': os.path.join(abs_dirs['abs_work_dir'], 'tools'),
-        })
+        }
+
+        for key in dirs.keys():
+            if key not in abs_dirs:
+                abs_dirs[key] = dirs[key]
         self.abs_dirs = abs_dirs
 
         return self.abs_dirs
 
     def read_release_update_config(self):
         '''
         Builds a testing matrix based on an update verification configuration
         file under the tools repository (release/updates/*.cfg).