Bug 1197365 - Enable e10s for web-platform-tests, r=ahal,Ms2ger
authorJames Graham <james@hoppipolla.co.uk>
Thu, 27 Aug 2015 18:45:50 +0100
changeset 260339 b5b60f000985c985009c9efd7876877176fcc50b
parent 260338 0021aceac846d189cbdaf38e845cac52a0d917de
child 260340 8155fcf40b60ed96b93a55c033406ea06e3baf71
push id29307
push userryanvm@gmail.com
push dateWed, 02 Sep 2015 01:01:53 +0000
treeherdermozilla-central@e2eb0442ece9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal, Ms2ger
bugs1197365
milestone43.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 1197365 - Enable e10s for web-platform-tests, r=ahal,Ms2ger
testing/mozharness/scripts/web_platform_tests.py
testing/web-platform/harness/wptrunner/browsers/firefox.py
testing/web-platform/harness/wptrunner/manifestupdate.py
testing/web-platform/harness/wptrunner/products.py
testing/web-platform/harness/wptrunner/wptrunner.py
testing/web-platform/harness/wptrunner/wpttest.py
--- a/testing/mozharness/scripts/web_platform_tests.py
+++ b/testing/mozharness/scripts/web_platform_tests.py
@@ -21,16 +21,21 @@ from mozharness.base.log import INFO
 
 class WebPlatformTest(TestingMixin, MercurialScript, BlobUploadMixin):
     config_options = [
         [['--test-type'], {
             "action": "extend",
             "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",
             "help": "Number of total chunks"}
          ],
         [["--this-chunk"], {
             "action": "store",
             "dest": "this_chunk",
@@ -123,16 +128,19 @@ class WebPlatformTest(TestingMixin, Merc
                                                    "wpt_raw.log"),
                      "--binary=%s" % self.binary_path,
                      "--symbols-path=%s" % self.query_symbols_url(),
                      "--stackwalk-binary=%s" % self.query_minidump_stackwalk()]
 
         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:
                 base_cmd.append("--%s=%s" % (opt.replace("_", "-"), val))
 
         options = list(c.get("options", []))
 
         str_format_values = {
--- a/testing/web-platform/harness/wptrunner/browsers/firefox.py
+++ b/testing/web-platform/harness/wptrunner/browsers/firefox.py
@@ -22,17 +22,18 @@ here = os.path.join(os.path.split(__file
 
 __wptrunner__ = {"product": "firefox",
                  "check_args": "check_args",
                  "browser": "FirefoxBrowser",
                  "executor": {"testharness": "MarionetteTestharnessExecutor",
                               "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):
     require_arg(kwargs, "binary")
     if kwargs["ssl_type"] != "none":
         require_arg(kwargs, "certutil_binary")
 
 
@@ -59,16 +60,18 @@ def executor_kwargs(test_type, server_co
 
 def env_options():
     return {"host": "127.0.0.1",
             "external_host": "web-platform.test",
             "bind_hostname": "false",
             "certificate_domain": "web-platform.test",
             "supports_debugger": True}
 
+def run_info_extras(**kwargs):
+    return {"e10s": kwargs["gecko_e10s"]}
 
 class FirefoxBrowser(Browser):
     used_ports = set()
 
     def __init__(self, logger, binary, prefs_root, debug_info=None,
                  symbols_path=None, stackwalk_binary=None, certutil_binary=None,
                  ca_certificate_path=None, e10s=False):
         Browser.__init__(self, logger)
--- a/testing/web-platform/harness/wptrunner/manifestupdate.py
+++ b/testing/web-platform/harness/wptrunner/manifestupdate.py
@@ -324,17 +324,17 @@ def group_conditionals(values):
     # for all the values
     if len(values) > 1:
         for key, statuses in by_property.copy().iteritems():
             if len(statuses) == len(values):
                 del by_property[key]
 
     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:
         if prop in properties:
             include_props.append(prop)
 
     conditions = {}
 
@@ -351,17 +351,17 @@ def group_conditionals(values):
 
 def make_expr(prop_set, status):
     """Create an AST that returns the value ``status`` given all the
     properties in prop_set match."""
     root = ConditionalNode()
 
     assert len(prop_set) > 0
 
-    no_value_props = set(["debug"])
+    no_value_props = set(["debug", "e10s"])
 
     expressions = []
     for prop, value in prop_set:
         number_types = (int, float, long)
         value_cls = (NumberNode
                      if type(value) in number_types
                      else StringNode)
         if prop not in no_value_props:
--- a/testing/web-platform/harness/wptrunner/products.py
+++ b/testing/web-platform/harness/wptrunner/products.py
@@ -38,18 +38,20 @@ def load_product(config, product):
     module = product_module(config, product)
     data = module.__wptrunner__
 
     check_args = getattr(module, data["check_args"])
     browser_cls = getattr(module, data["browser"])
     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():
         cls = getattr(module, cls_name)
         executor_classes[test_type] = cls
 
     return (check_args,
             browser_cls, browser_kwargs,
             executor_classes, executor_kwargs,
-            env_options)
+            env_options, run_info_extras)
--- a/testing/web-platform/harness/wptrunner/wptrunner.py
+++ b/testing/web-platform/harness/wptrunner/wptrunner.py
@@ -35,18 +35,22 @@ The upstream repository has the facility
 format. This manifest is used directly to determine which tests exist. Local
 metadata files are used to store the expected test results.
 """
 
 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()
 
     manifest_filters = []
     meta_filters = []
 
     if kwargs["include"] or kwargs["exclude"] or kwargs["include_manifest"]:
         manifest_filters.append(testloader.TestFilter(include=kwargs["include"],
@@ -106,27 +110,31 @@ def get_pause_after_test(test_loader, **
 
 def run_tests(config, test_paths, product, **kwargs):
     with wptlogging.CaptureIO(logger, not kwargs["no_capture_stdio"]):
         env.do_delayed_imports(logger, test_paths)
 
         (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:
             test_source_cls = testloader.SingleTestSource
             test_source_kwargs = {}
         else:
             # A value of None indicates infinite depth
             test_source_cls = testloader.PathGroupedSource
--- a/testing/web-platform/harness/wptrunner/wpttest.py
+++ b/testing/web-platform/harness/wptrunner/wpttest.py
@@ -52,25 +52,27 @@ class TestharnessSubtestResult(SubtestRe
 def get_run_info(metadata_root, product, **kwargs):
     if product == "b2g":
         return B2GRunInfo(metadata_root, product, **kwargs)
     else:
         return RunInfo(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
         if debug is not None:
             self["debug"] = debug
         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
         directory"""
         path = metadata_root
         dirs = set()
         while path != os.path.expanduser('~'):
             if path in dirs: