Bug 1642107 [wpt PR 23883] - Remove ability to specify sub-product with ':', a=testonly
authorStephen McGruer <smcgruer@chromium.org>
Thu, 04 Jun 2020 16:04:51 +0000
changeset 533930 79c097dc71b9fa6d6216be3d80b786de03a0b0dd
parent 533929 31b1efa0874481e5b787f0114040212fae7b2a55
child 533931 9c865158199bd81a46875f37b872fb2497c879ab
push id37480
push userncsoregi@mozilla.com
push dateThu, 04 Jun 2020 22:00:12 +0000
treeherdermozilla-central@e33aea19d0c5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1642107, 23883, 23875
milestone79.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 1642107 [wpt PR 23883] - Remove ability to specify sub-product with ':', a=testonly Automatic update from web-platform-tests Remove ability to specify subproduct with ':' This was only used in sauce, where you could set the product to something like sauce:firefox:63. There were multiple problems with it: - it wasn't documented, - it overlaps with the --sauce-browser and --sauce-version flags, and - it actually would crash wpt if you didn't set a sub-product, even thought it was meant to be optional! The first user of sauce in a long time ran into this problem immediately, so let's just remove it and make people use --sauce-browser and --sauce-version. Fixes https://github.com/web-platform-tests/wpt/issues/23875 -- wpt-commits: f5dbcc58e598553fdc5df57b4f57415577192797 wpt-pr: 23883 Differential Revision: https://phabricator.services.mozilla.com/D78329
testing/web-platform/tests/tools/wpt/run.py
testing/web-platform/tests/tools/wpt/tests/test_run.py
--- a/testing/web-platform/tests/tools/wpt/run.py
+++ b/testing/web-platform/tests/tools/wpt/run.py
@@ -151,21 +151,20 @@ in PowerShell with Administrator privile
                                           hosts_path)
                 raise WptrunError(message)
 
 
 class BrowserSetup(object):
     name = None
     browser_cls = None
 
-    def __init__(self, venv, prompt=True, sub_product=None):
+    def __init__(self, venv, prompt=True):
         self.browser = self.browser_cls(logger)
         self.venv = venv
         self.prompt = prompt
-        self.sub_product = sub_product
 
     def prompt_install(self, component):
         if not self.prompt:
             return True
         while True:
             resp = input("Download and install %s [Y/n]? " % component).strip().lower()
             if not resp or resp == "y":
                 return True
@@ -583,18 +582,20 @@ class Safari(BrowserSetup):
 class Sauce(BrowserSetup):
     name = "sauce"
     browser_cls = browser.Sauce
 
     def install(self, channel=None):
         raise NotImplementedError
 
     def setup_kwargs(self, kwargs):
-        kwargs.set_if_none("sauce_browser", self.sub_product[0])
-        kwargs.set_if_none("sauce_version", self.sub_product[1])
+        if kwargs["sauce_browser"] is None:
+            raise WptrunError("Missing required argument --sauce-browser")
+        if kwargs["sauce_version"] is None:
+            raise WptrunError("Missing required argument --sauce-version")
         kwargs["test_types"] = ["testharness", "reftest"]
 
 
 class Servo(BrowserSetup):
     name = "servo"
     browser_cls = browser.Servo
 
     def install(self, channel=None):
@@ -714,27 +715,25 @@ def setup_logging(kwargs, default_config
 
 
 def setup_wptrunner(venv, prompt=True, install_browser=False, **kwargs):
     from wptrunner import wptcommandline
     from six import iteritems
 
     kwargs = utils.Kwargs(iteritems(kwargs))
 
-    product_parts = kwargs["product"].split(":")
-    kwargs["product"] = product_parts[0].replace("-", "_")
-    sub_product = product_parts[1:]
+    kwargs["product"] = kwargs["product"].replace("-", "_")
 
     check_environ(kwargs["product"])
     args_general(kwargs)
 
     if kwargs["product"] not in product_setup:
         raise WptrunError("Unsupported product %s" % kwargs["product"])
 
-    setup_cls = product_setup[kwargs["product"]](venv, prompt, sub_product)
+    setup_cls = product_setup[kwargs["product"]](venv, prompt)
     setup_cls.install_requirements()
 
     affected_revish = kwargs.pop("affected", None)
     if affected_revish is not None:
         # TODO: Consolidate with `./wpt tests-affected --ignore-rules`:
         # https://github.com/web-platform-tests/wpt/issues/14560
         files_changed, _ = testfiles.files_changed(
             affected_revish,
--- a/testing/web-platform/tests/tools/wpt/tests/test_run.py
+++ b/testing/web-platform/tests/tools/wpt/tests/test_run.py
@@ -64,10 +64,11 @@ def test_setup_wptrunner(venv, logger, p
         pytest.skip("Android emulator doesn't work on docker")
     parser = run.create_parser()
     kwargs = vars(parser.parse_args(["--channel=nightly", product]))
     kwargs["prompt"] = False
     # Hack to get a real existing path
     kwargs["binary"] = sys.argv[0]
     kwargs["webdriver_binary"] = sys.argv[0]
     if kwargs["product"] == "sauce":
-        kwargs["product"] = "sauce:firefox:63"
+        kwargs["sauce_browser"] = "firefox"
+        kwargs["sauce_version"] = "63"
     run.setup_wptrunner(venv, **kwargs)