Bug 1495601 - Do not raise error if jstests.py is executed without virtualenv on non-automation. r=sfink
authorTooru Fujisawa <arai_a@mac.com>
Tue, 02 Oct 2018 11:28:43 +0900
changeset 494863 6568853848ac62384a094e521965e101978b1f62
parent 494862 95702d979c2ae4f45e5bfc1e5a566b50ab3772bc
child 494864 2b4331c9d829043af5513f3f1b97f53026928d8c
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1495601
milestone64.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 1495601 - Do not raise error if jstests.py is executed without virtualenv on non-automation. r=sfink
js/src/tests/jstests.py
testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
--- a/js/src/tests/jstests.py
+++ b/js/src/tests/jstests.py
@@ -349,18 +349,20 @@ def load_wpt_tests(requested_paths, excl
         for test in it:
             if test[1].get("jsshell"):
                 yield test
 
     test_manifests = testloader.ManifestLoader(test_paths, types=["testharness"],
                                                meta_filters=[filter_jsshell_tests]).load()
 
     run_info_extras = products.load_product(kwargs["config"], "firefox")[-1](**kwargs)
+    is_automation = os.environ.get('AUTOMATION', False)
     run_info = wpttest.get_run_info(kwargs["metadata_root"], "firefox",
-                                    debug=debug, extras=run_info_extras)
+                                    debug=debug, extras=run_info_extras,
+                                    raise_exception=is_automation)
 
     path_filter = testloader.TestFilter(test_manifests,
                                         include=requested_paths,
                                         exclude=excluded_paths)
     loader = testloader.TestLoader(test_manifests,
                                    ["testharness"],
                                    run_info,
                                    manifest_filters=[path_filter])
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/wpttest.py
@@ -66,19 +66,20 @@ def get_run_info(metadata_root, product,
     return RunInfo(metadata_root, product, **kwargs)
 
 
 class RunInfo(dict):
     def __init__(self, metadata_root, product, debug,
                  browser_version=None,
                  browser_channel=None,
                  verify=None,
-                 extras=None):
+                 extras=None,
+                 raise_exception=True):
         import mozinfo
-        self._update_mozinfo(metadata_root)
+        self._update_mozinfo(metadata_root, raise_exception=raise_exception)
         self.update(mozinfo.info)
 
         from update.tree import GitTree
         try:
             # GitTree.__init__ throws if we are not in a git tree.
             rev = GitTree(log_error=False).rev
         except (OSError, subprocess.CalledProcessError):
             rev = None
@@ -97,30 +98,30 @@ class RunInfo(dict):
             self["browser_channel"] = browser_channel
 
         self["verify"] = verify
         if "wasm" not in self:
             self["wasm"] = False
         if extras is not None:
             self.update(extras)
 
-    def _update_mozinfo(self, metadata_root):
+    def _update_mozinfo(self, metadata_root, **kwargs):
         """Add extra build information from a mozinfo.json file in a parent
         directory"""
         import mozinfo
 
         path = metadata_root
         dirs = set()
         while path != os.path.expanduser('~'):
             if path in dirs:
                 break
             dirs.add(str(path))
             path = os.path.split(path)[0]
 
-        mozinfo.find_and_update_from_json(*dirs)
+        mozinfo.find_and_update_from_json(*dirs, **kwargs)
 
 
 class Test(object):
 
     result_cls = None
     subtest_result_cls = None
     test_type = None