Bug 1283791 - Firefox-ui-tests taskcluster tasks have to upload reports (html, xml) as artifacts. draft
authorHenrik Skupin <mail@hskupin.info>
Fri, 12 Aug 2016 13:42:38 +0200
changeset 399942 d16da27e7cb8ef09117e8215e2e94a4144c95048
parent 399408 0502bd9e025edde29777ba1de4280f9b52af4663
child 528108 2fbfbecef4c96efb3fdc6034b9ea64da1fc2024d
push id26043
push userbmo:hskupin@gmail.com
push dateFri, 12 Aug 2016 11:44:22 +0000
bugs1283791
milestone51.0a1
Bug 1283791 - Firefox-ui-tests taskcluster tasks have to upload reports (html, xml) as artifacts. MozReview-Commit-ID: KNi71IFE3As
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -119,38 +119,28 @@ class FirefoxUITests(TestingMixin, VCSTo
 
         # Code which doesn't run on buildbot has to include the following properties
         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.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'}
-
         if not self.test_url and not self.test_packages_url:
             self.fatal(
                 'You must use --test-url, or --test-packages-url')
 
     @PreScriptAction('create-virtualenv')
     def _pre_create_virtualenv(self, action):
         dirs = self.query_abs_dirs()
 
         requirements = os.path.join(dirs['abs_test_install_dir'],
                                     'config', 'firefox_ui_requirements.txt')
         self.register_virtualenv_module(requirements=[requirements], two_pass=True)
 
-    def clobber(self):
-        """Delete the working directory"""
-        super(FirefoxUITests, self).clobber()
-
-        # Also ensure to delete the reports directory to get rid of old files
-        dirs = self.query_abs_dirs()
-        self.rmtree(dirs['abs_reports_dir'], error_level=FATAL)
-
     def download_and_extract(self):
         """Overriding method from TestingMixin for more specific behavior.
 
         We use the test_packages_url command line argument to check where to get the
         harness, puppeteer, and tests from and how to set them up.
 
         """
         target_unzip_dirs = ['config/*',
@@ -166,17 +156,16 @@ class FirefoxUITests(TestingMixin, VCSTo
         if self.abs_dirs:
             return self.abs_dirs
 
         abs_dirs = super(FirefoxUITests, self).query_abs_dirs()
         abs_tests_install_dir = os.path.join(abs_dirs['abs_work_dir'], 'tests')
 
         dirs = {
             'abs_blob_upload_dir': os.path.join(abs_dirs['abs_work_dir'], 'blobber_upload_dir'),
-            'abs_reports_dir': os.path.join(abs_dirs['base_work_dir'], 'reports'),
             'abs_test_install_dir': abs_tests_install_dir,
             'abs_fxui_dir': os.path.join(abs_tests_install_dir, 'firefox-ui'),
         }
 
         for key in dirs:
             if key not in abs_dirs:
                 abs_dirs[key] = dirs[key]
         self.abs_dirs = abs_dirs
@@ -198,33 +187,16 @@ class FirefoxUITests(TestingMixin, VCSTo
             if name:
                 if type(name) is bool:
                     args.append(option[0][0])
                 else:
                     args.extend([option[0][0], self.config[dest]])
 
         return args
 
-    @PostScriptRun
-    def copy_logs_to_upload_dir(self):
-        """Overwrite this method so we also upload the other (e.g. report) files"""
-        # Copy logs and report files to the upload folder
-        super(FirefoxUITests, self).copy_logs_to_upload_dir()
-
-        dirs = self.query_abs_dirs()
-        self.info("Copying reports to upload dir...")
-        for report in self.reports:
-            self.copy_to_upload_dir(os.path.join(dirs['abs_reports_dir'], self.reports[report]),
-                                    dest=os.path.join('reports', self.reports[report]),
-                                    short_desc='%s log' % self.reports[report],
-                                    long_desc='%s log' % self.reports[report],
-                                    max_backups=self.config.get("log_max_rotate", 0),
-                                    error_level=WARNING,
-                                    )
-
     def run_test(self, binary_path, env=None, marionette_port=2828):
         """All required steps for running the tests against an installer."""
         dirs = self.query_abs_dirs()
 
         # Import the harness to retrieve the location of the cli scripts
         import firefox_ui_harness
 
         cmd = [
@@ -240,18 +212,18 @@ class FirefoxUITests(TestingMixin, VCSTo
             # Use the work dir to get temporary data stored
             '--workspace', dirs['abs_work_dir'],
 
             # logging options
             '--gecko-log=-',  # output from the gecko process redirected to stdout
             '--log-raw=-',  # structured log for output parser redirected to stdout
 
             # additional reports helpful for Jenkins and inpection via Treeherder
-            '--log-html', os.path.join(dirs["abs_reports_dir"], self.reports['html']),
-            '--log-xunit', os.path.join(dirs["abs_reports_dir"], self.reports['xunit']),
+            '--log-html', os.path.join(dirs['abs_blob_upload_dir'], 'report.html'),
+            '--log-xunit', os.path.join(dirs['abs_blob_upload_dir'], 'report.xml'),
         ]
 
         # Collect all pass-through harness options to the script
         cmd.extend(self.query_harness_args())
 
         # Translate deprecated --e10s flag
         if not self.config.get('e10s'):
             cmd.append('--disable-e10s')