Bug 1157218 - Update to latest wptrunner, a=testonly
authorJames Graham <james@hoppipolla.co.uk>
Wed, 22 Apr 2015 09:09:00 +0100
changeset 240568 7262ddb5c573c0405173e90e33888819df2b5042
parent 240567 233827a516a88644baa7f1160aac836220e4f82a
child 240569 f6565bf7c16a73c1134323ab17d9e0f809d5ff47
push id28636
push userkwierso@gmail.com
push dateThu, 23 Apr 2015 00:16:12 +0000
treeherdermozilla-central@a5af73b32ac8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1157218
milestone40.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 1157218 - Update to latest wptrunner, a=testonly
testing/web-platform/harness/wptrunner/browsers/servo.py
testing/web-platform/harness/wptrunner/executors/executorservo.py
testing/web-platform/harness/wptrunner/executors/process.py
testing/web-platform/harness/wptrunner/manifestinclude.py
testing/web-platform/harness/wptrunner/wptcommandline.py
--- a/testing/web-platform/harness/wptrunner/browsers/servo.py
+++ b/testing/web-platform/harness/wptrunner/browsers/servo.py
@@ -21,36 +21,33 @@ here = os.path.join(os.path.split(__file
 
 
 def check_args(**kwargs):
     require_arg(kwargs, "binary")
 
 
 def browser_kwargs(**kwargs):
     return {"binary": kwargs["binary"],
-            "debug_info": kwargs["debug_info"],
-            "interactive": kwargs["interactive"]}
+            "debug_info": kwargs["debug_info"]}
 
 
 def executor_kwargs(test_type, server_config, cache_manager, **kwargs):
     rv = base_executor_kwargs(test_type, server_config,
                               cache_manager, **kwargs)
     rv["pause_after_test"] = kwargs["pause_after_test"]
     return rv
 
 def env_options():
     return {"host": "localhost",
             "bind_hostname": "true",
             "testharnessreport": "testharnessreport-servo.js",
             "supports_debugger": True}
 
 
 class ServoBrowser(NullBrowser):
-    def __init__(self, logger, binary, debug_info=None, interactive=False):
+    def __init__(self, logger, binary, debug_info=None):
         NullBrowser.__init__(self, logger)
         self.binary = binary
         self.debug_info = debug_info
-        self.interactive = interactive
 
     def executor_browser(self):
         return ExecutorBrowser, {"binary": self.binary,
-                                 "debug_info": self.debug_info,
-                                 "interactive": self.interactive}
+                                 "debug_info": self.debug_info}
--- a/testing/web-platform/harness/wptrunner/executors/executorservo.py
+++ b/testing/web-platform/harness/wptrunner/executors/executorservo.py
@@ -16,17 +16,17 @@ from collections import defaultdict
 from mozprocess import ProcessHandler
 
 from .base import (ExecutorException,
                    Protocol,
                    RefTestImplementation,
                    testharness_result_converter,
                    reftest_result_converter)
 from .process import ProcessTestExecutor
-from ..executors.base import browser_command
+from ..browsers.base import browser_command
 
 hosts_text = """127.0.0.1 web-platform.test
 127.0.0.1 www.web-platform.test
 127.0.0.1 www1.web-platform.test
 127.0.0.1 www2.web-platform.test
 127.0.0.1 xn--n8j6ds53lwwkrqhv28a.web-platform.test
 127.0.0.1 xn--lve-6lad.web-platform.test
 """
@@ -70,39 +70,45 @@ class ServoTestharnessExecutor(ProcessTe
         if self.pause_after_test:
             self.command.remove("-z")
 
         self.command = debug_args + self.command
 
         env = os.environ.copy()
         env["HOST_FILE"] = self.hosts_path
 
-        self.proc = ProcessHandler(self.command,
-                                   processOutputLine=[self.on_output],
-                                   onFinish=self.on_finish,
-                                   env=env)
+
+
+        if not self.interactive:
+            self.proc = ProcessHandler(self.command,
+                                       processOutputLine=[self.on_output],
+                                       onFinish=self.on_finish,
+                                       env=env,
+                                       storeOutput=False)
+            self.proc.run()
+        else:
+            self.proc = subprocess.Popen(self.command, env=env)
 
         try:
-            self.proc.run()
-
             timeout = test.timeout * self.timeout_multiplier
 
             # Now wait to get the output we expect, or until we reach the timeout
-            if self.debug_info is None and not self.pause_after_test:
+            if not self.interactive and not self.pause_after_test:
                 wait_timeout = timeout + 5
+                self.result_flag.wait(wait_timeout)
             else:
                 wait_timeout = None
-            self.result_flag.wait(wait_timeout)
+                self.proc.wait()
 
             proc_is_running = True
             if self.result_flag.is_set() and self.result_data is not None:
                 self.result_data["test"] = test.url
                 result = self.convert_result(test, self.result_data)
             else:
-                if self.proc.proc.poll() is not None:
+                if self.proc.poll() is not None:
                     result = (test.result_cls("CRASH", None), [])
                     proc_is_running = False
                 else:
                     result = (test.result_cls("TIMEOUT", None), [])
 
             if proc_is_running:
                 if self.pause_after_test:
                     self.logger.info("Pausing until the browser exits")
--- a/testing/web-platform/harness/wptrunner/executors/process.py
+++ b/testing/web-platform/harness/wptrunner/executors/process.py
@@ -4,17 +4,18 @@
 
 from .base import TestExecutor
 
 
 class ProcessTestExecutor(TestExecutor):
     def __init__(self, *args, **kwargs):
         TestExecutor.__init__(self, *args, **kwargs)
         self.binary = self.browser.binary
-        self.interactive = self.browser.interactive
+        self.interactive = (False if self.debug_info is None
+                            else self.debug_info.interactive)
 
     def setup(self, runner):
         self.runner = runner
         self.runner.send_message("init_succeeded")
         return True
 
     def is_alive(self):
         return True
--- a/testing/web-platform/harness/wptrunner/manifestinclude.py
+++ b/testing/web-platform/harness/wptrunner/manifestinclude.py
@@ -90,17 +90,17 @@ class IncludeManifest(ManifestItem):
             variant += "?" + query
 
         maybe_path = os.path.join(rest, last)
 
         if os.path.exists(maybe_path):
             for manifest, data in test_manifests.iteritems():
                 rel_path = os.path.relpath(maybe_path, data["tests_path"])
                 if ".." not in rel_path.split(os.sep):
-                    url = "/" + rel_path.replace(os.path.sep, "/") + variant
+                    url = data["url_base"] + rel_path.replace(os.path.sep, "/") + variant
                     break
 
         assert direction in ("include", "exclude")
         components = self._get_components(url)
 
         node = self
         while components:
             component = components.pop()
--- a/testing/web-platform/harness/wptrunner/wptcommandline.py
+++ b/testing/web-platform/harness/wptrunner/wptcommandline.py
@@ -271,17 +271,18 @@ def check_args(kwargs):
 
     if kwargs["debugger"] is not None:
         import mozdebug
         if kwargs["debugger"] == "__default__":
             kwargs["debugger"] = mozdebug.get_default_debugger_name()
         debug_info = mozdebug.get_debugger_info(kwargs["debugger"],
                                                 kwargs["debugger_args"])
         if debug_info.interactive:
-            require_arg(kwargs, "processes", lambda x: x == 1)
+            if kwargs["processes"] != 1:
+                kwargs["processes"] = 1
             kwargs["no_capture_stdio"] = True
         kwargs["debug_info"] = debug_info
     else:
         kwargs["debug_info"] = None
 
     if kwargs["binary"] is not None:
         if not os.path.exists(kwargs["binary"]):
             print >> sys.stderr, "Binary path %s does not exist" % kwargs["binary"]