Bug 1286900 - Use WPT files from source checkout; r?ted draft
authorGregory Szorc <gps@mozilla.com>
Mon, 26 Sep 2016 23:32:31 -0700
changeset 420711 e33a5d16d4042c0b89e1455ab7c071481ab0481f
parent 420710 a2d61ab062246e982266cb37df5a235734d953c1
child 420712 4bda1b4ba90f0fc04c93cf5aacb45bb9fed886e5
push id31266
push usergszorc@mozilla.com
push dateTue, 04 Oct 2016 13:39:23 +0000
reviewersted
bugs1286900
milestone52.0a1
Bug 1286900 - Use WPT files from source checkout; r?ted We're starting to execute mozharness scripts from source checkouts in automation. This means we can stop downloading and extracting files that are already available in the source checkout and just reference files from the checkout. Web platform tests (WPT) are a logical place to start because they are pretty well isolated. This commit modifies the mozharness script for WPT execution to use files from a source checkout (previous commits have guaranteed that a pristine source checkout is available to the test execution environment). As part of this, we also need to define an explicit mozinfo.json path because previously it was relying on parent directory traversal to find it (WPT tests were under a directory containing the mozinfo.json file). MozReview-Commit-ID: C1dlKC4eSzr
testing/mozharness/scripts/web_platform_tests.py
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -93,17 +93,17 @@ class WebPlatformTest(TestingMixin, Merc
     def query_abs_dirs(self):
         if self.abs_dirs:
             return self.abs_dirs
         abs_dirs = super(WebPlatformTest, self).query_abs_dirs()
 
         dirs = {}
         dirs['abs_app_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'application')
         dirs['abs_test_install_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'tests')
-        dirs["abs_wpttest_dir"] = os.path.join(dirs['abs_test_install_dir'], "web-platform")
+        dirs['abs_wpttest_dir'] = os.path.join(abs_dirs['checkout'], 'testing', 'web-platform')
         dirs['abs_blob_upload_dir'] = os.path.join(abs_dirs['abs_work_dir'], 'blobber_upload_dir')
 
         abs_dirs.update(dirs)
         self.abs_dirs = abs_dirs
 
         return self.abs_dirs
 
     @PreScriptAction('create-virtualenv')
@@ -142,17 +142,17 @@ class WebPlatformTest(TestingMixin, Merc
             '--log-raw=-',
             '--log-raw=%s' % os.path.join(blob_upload_dir, 'wpt_raw.log'),
             '--log-errorsummary=%s' % os.path.join(blob_upload_dir,
                                                    'wpt_errorsummary.log'),
             '--binary=%s' % self.binary_path,
             '--symbols-path=%s' % self.query_symbols_url(),
             '--stackwalk-binary=%s' % self.query_minidump_stackwalk(),
             '--processes=1',
-            '--prefs-root=%s/prefs' % wpt_dir,
+            '--prefs-root=%s' % os.path.join(dirs['checkout'], 'testing', 'profiles'),
             '--config=%s/wptrunner.ini' % wpt_dir,
             '--ca-cert-path=%s/certs/cacert.pem' % wpt_dir,
             '--host-key-path=%s/certs/web-platform.test.key' % wpt_dir,
             '--host-cert-path=%s/certs/web-platform.test.pem' % wpt_dir,
             '--certutil-binary=%s/bin/certutil' % dirs['abs_test_install_dir'],
         ])
 
         for test_type in c.get("test_type", []):
@@ -192,17 +192,18 @@ class WebPlatformTest(TestingMixin, Merc
 
     def download_and_extract(self):
         super(WebPlatformTest, self).download_and_extract(
             extract_dirs=["bin/*",
                           "config/*",
                           "mozbase/*",
                           "marionette/*",
                           "tools/wptserve/*",
-                          "web-platform/*"],
+                          "web-platform/*",
+                          "mozinfo.json"],
             suite_categories=["web-platform"])
 
     def fetch_geckodriver(self):
         c = self.config
         dirs = self.query_abs_dirs()
 
         platform_name = self.platform_name()
 
@@ -240,17 +241,21 @@ class WebPlatformTest(TestingMixin, Merc
     def run_tests(self):
         dirs = self.query_abs_dirs()
         cmd = self._query_cmd()
 
         parser = StructuredOutputParser(config=self.config,
                                         log_obj=self.log_obj,
                                         log_compact=True)
 
-        env = {'MINIDUMP_SAVE_PATH': dirs['abs_blob_upload_dir']}
+        env = {
+            'MINIDUMP_SAVE_PATH': dirs['abs_blob_upload_dir'],
+            'MOZINFO_PATH': os.path.join(dirs['abs_test_install_dir'],
+                                         'mozinfo.json'),
+        }
 
         if self.config['allow_software_gl_layers']:
             env['MOZ_LAYERS_ALLOW_SOFTWARE_GL'] = '1'
 
         env = self.query_env(partial_env=env, log_level=INFO)
 
         return_code = self.run_command(cmd,
                                        cwd=dirs['abs_work_dir'],