From 95ed9487e0f918164fcd669d9b3aeb36c6b10e92 Mon Sep 17 00:00:00 2001 From: James Graham Date: Thu, 27 Aug 2015 18:45:50 +0100 Subject: [PATCH] Bug 1197365 - Enable e10s for web-platform-tests, r=ahal,Ms2ger --- .../mozharness/scripts/web_platform_tests.py | 8 ++++++++ .../harness/wptrunner/browsers/firefox.py | 5 ++++- .../harness/wptrunner/manifestupdate.py | 4 ++-- .../web-platform/harness/wptrunner/products.py | 4 +++- .../harness/wptrunner/wptrunner.py | 18 +++++++++++++----- .../web-platform/harness/wptrunner/wpttest.py | 4 +++- 6 files changed, 33 insertions(+), 10 deletions(-) diff --git a/testing/mozharness/scripts/web_platform_tests.py b/testing/mozharness/scripts/web_platform_tests.py index a82cf815bc66..f1982b2ca0c2 100755 --- a/testing/mozharness/scripts/web_platform_tests.py +++ b/testing/mozharness/scripts/web_platform_tests.py @@ -26,6 +26,11 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin): "dest": "test_type", "help": "Specify the test types to run."} ], + [['--e10s'], { + "action": "store_true", + "dest": "e10s", + "help": "Run with e10s enabled"} + ], [["--total-chunks"], { "action": "store", "dest": "total_chunks", @@ -128,6 +133,9 @@ class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin): for test_type in c.get("test_type", []): base_cmd.append("--test-type=%s" % test_type) + if c.get("e10s"): + base_cmd.append("--e10s") + for opt in ["total_chunks", "this_chunk"]: val = c.get(opt) if val: diff --git a/testing/web-platform/harness/wptrunner/browsers/firefox.py b/testing/web-platform/harness/wptrunner/browsers/firefox.py index 08670e4d5838..6bbe282d3e8e 100644 --- a/testing/web-platform/harness/wptrunner/browsers/firefox.py +++ b/testing/web-platform/harness/wptrunner/browsers/firefox.py @@ -27,7 +27,8 @@ __wptrunner__ = {"product": "firefox", "reftest": "MarionetteRefTestExecutor"}, "browser_kwargs": "browser_kwargs", "executor_kwargs": "executor_kwargs", - "env_options": "env_options"} + "env_options": "env_options", + "run_info_extras": "run_info_extras"} def check_args(**kwargs): @@ -64,6 +65,8 @@ def env_options(): "certificate_domain": "web-platform.test", "supports_debugger": True} +def run_info_extras(**kwargs): + return {"e10s": kwargs["gecko_e10s"]} class FirefoxBrowser(Browser): used_ports = set() diff --git a/testing/web-platform/harness/wptrunner/manifestupdate.py b/testing/web-platform/harness/wptrunner/manifestupdate.py index 944b35d7d931..0a5d46c0995e 100644 --- a/testing/web-platform/harness/wptrunner/manifestupdate.py +++ b/testing/web-platform/harness/wptrunner/manifestupdate.py @@ -329,7 +329,7 @@ def group_conditionals(values): properties = set(item[0] for item in by_property.iterkeys()) - prop_order = ["debug", "os", "version", "processor", "bits"] + prop_order = ["debug", "e10s", "os", "version", "processor", "bits"] include_props = [] for prop in prop_order: @@ -356,7 +356,7 @@ def make_expr(prop_set, status): assert len(prop_set) > 0 - no_value_props = set(["debug"]) + no_value_props = set(["debug", "e10s"]) expressions = [] for prop, value in prop_set: diff --git a/testing/web-platform/harness/wptrunner/products.py b/testing/web-platform/harness/wptrunner/products.py index ce467da6f9b2..f67a51cf300c 100644 --- a/testing/web-platform/harness/wptrunner/products.py +++ b/testing/web-platform/harness/wptrunner/products.py @@ -43,6 +43,8 @@ def load_product(config, product): browser_kwargs = getattr(module, data["browser_kwargs"]) executor_kwargs = getattr(module, data["executor_kwargs"]) env_options = getattr(module, data["env_options"])() + run_info_extras = (getattr(module, data["run_info_extras"]) + if "run_info_extras" in data else lambda **kwargs:{}) executor_classes = {} for test_type, cls_name in data["executor"].iteritems(): @@ -52,4 +54,4 @@ def load_product(config, product): return (check_args, browser_cls, browser_kwargs, executor_classes, executor_kwargs, - env_options) + env_options, run_info_extras) diff --git a/testing/web-platform/harness/wptrunner/wptrunner.py b/testing/web-platform/harness/wptrunner/wptrunner.py index 42923c2ae0df..29fd06a36194 100644 --- a/testing/web-platform/harness/wptrunner/wptrunner.py +++ b/testing/web-platform/harness/wptrunner/wptrunner.py @@ -40,8 +40,12 @@ def setup_logging(*args, **kwargs): global logger logger = wptlogging.setup(*args, **kwargs) -def get_loader(test_paths, product, ssl_env, debug=None, **kwargs): - run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=debug) +def get_loader(test_paths, product, ssl_env, debug=None, run_info_extras=None, **kwargs): + if run_info_extras is None: + run_info_extras = {} + + run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=debug, + extras=run_info_extras) test_manifests = testloader.ManifestLoader(test_paths, force_manifest_update=kwargs["manifest_update"]).load() @@ -111,17 +115,21 @@ def run_tests(config, test_paths, product, **kwargs): (check_args, browser_cls, get_browser_kwargs, executor_classes, get_executor_kwargs, - env_options) = products.load_product(config, product) + env_options, run_info_extras) = products.load_product(config, product) ssl_env = env.ssl_env(logger, **kwargs) check_args(**kwargs) if "test_loader" in kwargs: - run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=None) + run_info = wpttest.get_run_info(kwargs["run_info"], product, debug=None, + extras=run_info_extras(**kwargs)) test_loader = kwargs["test_loader"] else: - run_info, test_loader = get_loader(test_paths, product, ssl_env, + run_info, test_loader = get_loader(test_paths, + product, + ssl_env, + run_info_extras=run_info_extras(**kwargs), **kwargs) if kwargs["run_by_dir"] is False: diff --git a/testing/web-platform/harness/wptrunner/wpttest.py b/testing/web-platform/harness/wptrunner/wpttest.py index 635b1a2298e0..9186b9e96c2b 100644 --- a/testing/web-platform/harness/wptrunner/wpttest.py +++ b/testing/web-platform/harness/wptrunner/wpttest.py @@ -57,7 +57,7 @@ def get_run_info(metadata_root, product, **kwargs): class RunInfo(dict): - def __init__(self, metadata_root, product, debug): + def __init__(self, metadata_root, product, debug, extras=None): self._update_mozinfo(metadata_root) self.update(mozinfo.info) self["product"] = product @@ -66,6 +66,8 @@ class RunInfo(dict): elif "debug" not in self: # Default to release self["debug"] = False + if extras is not None: + self.update(extras) def _update_mozinfo(self, metadata_root): """Add extra build information from a mozinfo.json file in a parent