Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade wptrunner #12223

Closed
wants to merge 8 commits into from
@@ -143,25 +143,28 @@ def grep(self, params):
["git"] + ["grep"] + params + ['--'] + grep_paths + [':(exclude)*.min.js'],
env=self.build_env())

@Command('wpt-upgrade',
@Command('wptrunner-upgrade',
description='upgrade wptrunner.',
category='devenv')
def upgrade_wpt_runner(self):
env = self.build_env()
with cd(path.join(self.context.topdir, 'tests', 'wpt', 'harness')):
code = call(["git", "init"], env=self.build_env())
code = call(["git", "init"], env=env)
if code:
return code
# No need to report an error if this fails, as it will for the first use
call(["git", "remote", "rm", "upstream"], env=env)
code = call(
["git", "remote", "add", "upstream", "https://github.com/w3c/wptrunner.git"], env=self.build_env())
["git", "remote", "add", "upstream", "https://github.com/w3c/wptrunner.git"], env=env)
if code:
return code
code = call(["git", "fetch", "upstream"], env=self.build_env())
code = call(["git", "fetch", "upstream"], env=env)
if code:
return code
code = call(["git", "reset", "--hard", "remotes/upstream/master"], env=self.build_env())
code = call(["git", "reset", "--hard", "remotes/upstream/master"], env=env)
if code:
return code
code = call(["rm", "-rf", ".git"], env=self.build_env())
code = call(["rm", "-rf", ".git"], env=env)
if code:
return code
return 0
@@ -0,0 +1,26 @@
language: python
python: 2.7

sudo: false

cache:
directories:
- $HOME/.cache/pip

env:
- TOXENV=py27-base
- TOXENV=py27-b2g
- TOXENV=py27-chrome
- TOXENV=py27-firefox
- TOXENV=py27-servo
- TOXENV=pypy-base
- TOXENV=pypy-b2g
- TOXENV=pypy-chrome
- TOXENV=pypy-firefox
- TOXENV=pypy-servo

install:
- pip install -U tox

script:
- tox
@@ -0,0 +1,16 @@
[pytest]
xfail_strict=true

[tox]
envlist = {py27,pypy}-{base,b2g,chrome,firefox,servo}

[testenv]
deps =
pytest>=2.9
-r{toxinidir}/requirements.txt
b2g: -r{toxinidir}/requirements_b2g.txt
chrome: -r{toxinidir}/requirements_chrome.txt
firefox: -r{toxinidir}/requirements_firefox.txt
servo: -r{toxinidir}/requirements_servo.txt

commands = py.test []
@@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import os
import platform
import subprocess
import sys

@@ -128,10 +129,16 @@ def start(self):
self.profile.set_preferences({"marionette.defaultPrefs.enabled": True,
"marionette.defaultPrefs.port": self.marionette_port,
"dom.disable_open_during_load": False,
"network.dns.localDomains": ",".join(hostnames)})
"network.dns.localDomains": ",".join(hostnames),
"places.history.enabled": False})
if self.e10s:
self.profile.set_preferences({"browser.tabs.remote.autostart": True})

# Bug 1262954: winxp + e10s, disable hwaccel
if (self.e10s and platform.system() in ("Windows", "Microsoft") and
'5.1' in platform.version()):
self.profile.set_preferences({"layers.acceleration.disabled": True})

if self.ca_certificate_path is not None:
self.setup_ssl()

@@ -6,15 +6,16 @@

from .base import NullBrowser, ExecutorBrowser, require_arg
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorservo import ServoTestharnessExecutor, ServoRefTestExecutor
from ..executors.executorservo import ServoTestharnessExecutor, ServoRefTestExecutor, ServoWdspecExecutor

here = os.path.join(os.path.split(__file__)[0])

__wptrunner__ = {"product": "servo",
"check_args": "check_args",
"browser": "ServoBrowser",
"executor": {"testharness": "ServoTestharnessExecutor",
"reftest": "ServoRefTestExecutor"},
"reftest": "ServoRefTestExecutor",
"wdspec": "ServoWdspecExecutor"},
"browser_kwargs": "browser_kwargs",
"executor_kwargs": "executor_kwargs",
"env_options": "env_options",

This file was deleted.

@@ -292,7 +292,7 @@ def is_alive(self):
class ExecuteAsyncScriptRun(object):
def __init__(self, logger, func, marionette, url, timeout):
self.logger = logger
self.result = None
self.result = (None, None)
self.marionette = marionette
self.func = func
self.url = url
@@ -323,11 +323,9 @@ def run(self):
wait_timeout = None

flag = self.result_flag.wait(wait_timeout)
if self.result is None:
if self.result[1] is None:
self.logger.debug("Timed out waiting for a result")
assert not flag
self.result = False, ("EXTERNAL-TIMEOUT", None)

return self.result

def _run(self):
@@ -409,7 +407,8 @@ def do_testharness(self, marionette, url, timeout):
"timeout": timeout_ms,
"explicit_timeout": timeout is None}

return marionette.execute_async_script(script, new_sandbox=False)
rv = marionette.execute_async_script(script, new_sandbox=False)
return rv


class MarionetteRefTestExecutor(RefTestExecutor):
@@ -487,7 +486,7 @@ def _screenshot(self, marionette, url, timeout):
class WdspecRun(object):
def __init__(self, func, session, path, timeout):
self.func = func
self.result = None
self.result = (None, None)
self.session = session
self.path = path
self.timeout = timeout
@@ -504,8 +503,7 @@ def run(self):
executor.start()

flag = self.result_flag.wait(self.timeout)
if self.result is None:
assert not flag
if self.result[1] is None:
self.result = False, ("EXTERNAL-TIMEOUT", None)

return self.result
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.