Update web-platform-tests to revision 8ae1ddbc812733c3a73b103eafad56fb43a2f4b5

This commit is contained in:
WPT Sync Bot 2019-01-26 20:37:16 -05:00
parent d44e9aced2
commit 0e5e5db397
109 changed files with 2053 additions and 708 deletions

View file

@ -15,9 +15,9 @@ passenv =
HYPOTHESIS_PROFILE
[testenv:py27-flake8]
deps = -r requirements_flake8.txt
commands = flake8 --append-config=py27-flake8.ini {posargs}
deps = -rrequirements_flake8.txt
commands = flake8 --append-config={toxinidir}/py27-flake8.ini {posargs}
[testenv:py36-flake8]
deps = -r requirements_flake8.txt
commands = flake8 --append-config=py36-flake8.ini {posargs}
deps = -rrequirements_flake8.txt
commands = flake8 --append-config={toxinidir}/py36-flake8.ini {posargs}

View file

@ -171,7 +171,8 @@ class BrowserSetup(object):
return self.browser.install(venv.path, channel)
def install_requirements(self):
self.venv.install_requirements(os.path.join(wpt_root, "tools", "wptrunner", self.browser.requirements))
if not self.venv.skip_virtualenv_setup:
self.venv.install_requirements(os.path.join(wpt_root, "tools", "wptrunner", self.browser.requirements))
def setup(self, kwargs):
self.setup_kwargs(kwargs)
@ -563,7 +564,8 @@ def setup_wptrunner(venv, prompt=True, install_browser=False, **kwargs):
wptrunner_path = os.path.join(wpt_root, "tools", "wptrunner")
venv.install_requirements(os.path.join(wptrunner_path, "requirements.txt"))
if not venv.skip_virtualenv_setup:
venv.install_requirements(os.path.join(wptrunner_path, "requirements.txt"))
kwargs['browser_version'] = setup_cls.browser.version(binary=kwargs.get("binary"),
webdriver_binary=kwargs.get("webdriver_binary"))

View file

@ -17,6 +17,7 @@ def venv():
class Virtualenv(virtualenv.Virtualenv):
def __init__(self):
self.path = tempfile.mkdtemp()
self.skip_virtualenv_setup = False
def create(self):
return

View file

@ -357,7 +357,7 @@ def test_tests_affected_idlharness(capsys, manifest_dir):
wpt.main(argv=["tests-affected", "--metadata", manifest_dir, "%s~..%s" % (commit, commit)])
assert excinfo.value.code == 0
out, err = capsys.readouterr()
assert "webrtc/idlharness.https.window.js\n" == out
assert "webrtc-stats/idlharness.window.js\nwebrtc/idlharness.https.window.js\n" == out
@pytest.mark.slow # this updates the manifest

View file

@ -9,11 +9,13 @@ from tools.wpt.utils import call
logger = logging.getLogger(__name__)
class Virtualenv(object):
def __init__(self, path):
def __init__(self, path, skip_virtualenv_setup):
self.path = path
self.virtualenv = find_executable("virtualenv")
if not self.virtualenv:
raise ValueError("virtualenv must be installed and on the PATH")
self.skip_virtualenv_setup = skip_virtualenv_setup
if not skip_virtualenv_setup:
self.virtualenv = find_executable("virtualenv")
if not self.virtualenv:
raise ValueError("virtualenv must be installed and on the PATH")
@property
def exists(self):

View file

@ -43,6 +43,9 @@ def load_commands():
def parse_args(argv, commands):
parser = argparse.ArgumentParser()
parser.add_argument("--venv", action="store", help="Path to an existing virtualenv to use")
parser.add_argument("--skip-venv-setup", action="store_true",
dest="skip_venv_setup",
help="Whether to use the virtualenv as-is. Must set --venv as well")
parser.add_argument("--debug", action="store_true", help="Run the debugger in case of an exception")
subparsers = parser.add_subparsers(dest="command")
for command, props in iteritems(commands):
@ -77,15 +80,19 @@ def import_command(prog, command, props):
return script, parser
def setup_virtualenv(path, props):
def setup_virtualenv(path, skip_venv_setup, props):
if skip_venv_setup and path is None:
raise ValueError("Must set --venv when --skip-venv-setup is used")
should_skip_setup = path is not None and skip_venv_setup
if path is None:
path = os.path.join(wpt_root, "_venv")
venv = virtualenv.Virtualenv(path)
venv.start()
for name in props["install"]:
venv.install(name)
for path in props["requirements"]:
venv.install_requirements(path)
venv = virtualenv.Virtualenv(path, should_skip_setup)
if not should_skip_setup:
venv.start()
for name in props["install"]:
venv.install(name)
for path in props["requirements"]:
venv.install_requirements(path)
return venv
@ -105,7 +112,7 @@ def main(prog=None, argv=None):
props = commands[command]
venv = None
if props["virtualenv"]:
venv = setup_virtualenv(main_args.venv, props)
venv = setup_virtualenv(main_args.venv, main_args.skip_venv_setup, props)
script, parser = import_command(prog, command, props)
if parser:
if props["parse_known"]: