Bug 1417051 - Reorganize Firefox UI tests in test package for full path names in log files. draft
authorHenrik Skupin <mail@hskupin.info>
Fri, 01 Dec 2017 10:27:06 +0100
changeset 707452 8186f207e081b059c22d3b884a6b00c2b9028745
parent 707451 21a93dae1e9041189429a2ed2de5aaa855076166
child 742934 942bb881951783cc386ab3b497eb36eacef177a4
push id92108
push userbmo:hskupin@gmail.com
push dateTue, 05 Dec 2017 07:58:48 +0000
bugs1417051
milestone59.0a1
Bug 1417051 - Reorganize Firefox UI tests in test package for full path names in log files. The Firefox UI tests were packaged wrongly, and as such didn't use the real path as in tree. This patch fixes that by separating the packaging logic for the harness, and the tests. Also it updates the mozharness script to run the Firefox UI tests command by using the test folder as current working directory. This will make sure that the relative path to the tests is reported. It's identical to the location in the tree. MozReview-Commit-ID: 3YVfCw4RWfV
python/mozbuild/mozbuild/action/test_archive.py
testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
--- a/python/mozbuild/mozbuild/action/test_archive.py
+++ b/python/mozbuild/mozbuild/action/test_archive.py
@@ -147,16 +147,25 @@ ARCHIVE_FILES = {
             'source': buildconfig.topobjdir,
             'base': '_tests',
             'pattern': 'mozbase/**',
         },
         {
             'source': buildconfig.topsrcdir,
             'base': 'testing',
             'pattern': 'firefox-ui/**',
+            'ignore': [
+                'firefox-ui/tests',
+            ]
+        },
+        {
+            'source': buildconfig.topsrcdir,
+            'base': '',
+            'pattern': 'testing/firefox-ui/tests',
+            'dest': 'firefox-ui/tests',
         },
         {
             'source': buildconfig.topsrcdir,
             'base': 'js/src',
             'pattern': 'jit-test/**',
             'dest': 'jit-test',
         },
         {
--- a/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
+++ b/testing/mozharness/mozharness/mozilla/testing/firefox_ui_tests.py
@@ -157,19 +157,23 @@ class FirefoxUITests(TestingMixin, VCSTo
     def query_abs_dirs(self):
         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_blob_upload_dir': os.path.join(
+                abs_dirs['abs_work_dir'], 'blobber_upload_dir'),
+            'abs_fxui_dir': os.path.join(
+                abs_tests_install_dir, 'firefox-ui'),
+            'abs_fxui_manifest_dir': os.path.join(
+                abs_tests_install_dir, 'firefox-ui', 'tests', 'testing', 'firefox-ui', 'tests'),
             '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
 
         return self.abs_dirs
@@ -239,17 +243,17 @@ class FirefoxUITests(TestingMixin, VCSTo
         if self.config.get('tag'):
             cmd.extend(['--tag', self.config['tag']])
 
         parser = StructuredOutputParser(config=self.config,
                                         log_obj=self.log_obj,
                                         strict=False)
 
         # Add the default tests to run
-        tests = [os.path.join(dirs['abs_fxui_dir'], 'tests', test) for test in self.default_tests]
+        tests = [os.path.join(dirs['abs_fxui_manifest_dir'], t) for t in self.default_tests]
         cmd.extend(tests)
 
         # Set further environment settings
         env = env or self.query_env()
         env.update({'MINIDUMP_SAVE_PATH': dirs['abs_blob_upload_dir']})
         if self.query_minidump_stackwalk():
             env.update({'MINIDUMP_STACKWALK': self.minidump_stackwalk_path})
         env['RUST_BACKTRACE'] = 'full'
@@ -261,17 +265,17 @@ class FirefoxUITests(TestingMixin, VCSTo
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
         if self.config['enable_webrender']:
             env['MOZ_WEBRENDER'] = '1'
             env['MOZ_ACCELERATED'] = '1'
 
         return_code = self.run_command(cmd,
-                                       cwd=dirs['abs_work_dir'],
+                                       cwd=dirs['abs_fxui_dir'],
                                        output_timeout=1000,
                                        output_parser=parser,
                                        env=env)
 
         tbpl_status, log_level = parser.evaluate_parser(return_code)
         self.buildbot_status(tbpl_status, level=log_level)
 
         return return_code