Update web-platform-tests to revision 5084587f6b05bf99ad09e7844be66dcc61070cdf

This commit is contained in:
WPT Sync Bot 2018-04-25 21:10:30 -04:00 committed by Anthony Ramine
parent 6d42d2f1e8
commit 7d1071a6a4
408 changed files with 8968 additions and 2608 deletions

View file

@ -0,0 +1,7 @@
#!/bin/bash
if [ $1 == "firefox" ]; then
./wpt run firefox --log-tbpl=- --log-tbpl-level=debug --log-wptreport=../artifacts/wpt_report.json --this-chunk=$3 --total-chunks=$4 --test-type=$2 -y --install-browser --no-pause --no-restart-on-unexpected
elif [ $1 == "chrome" ]; then
./wpt run chrome --log-tbpl=- --log-tbpl-level=debug --log-wptreport=../artifacts/wpt_report.json --this-chunk=$3 --total-chunks=$4 --test-type=$2 -y --no-pause --no-restart-on-unexpected
fi

View file

@ -3,5 +3,7 @@
"virtualenv": false},
"check-stability": {"path": "check_stability.py", "script": "run", "parser": "get_parser", "parse_known": true, "help": "Check test stability",
"virtualenv": true, "install": ["requests"], "requirements": ["../wptrunner/requirements.txt"]},
"make-hosts-file": {"path": "make_hosts_file.py", "script": "run", "parser": "create_parser", "help": "Output a hosts file to stdout", "virtualenv": false}
"make-hosts-file": {"path": "make_hosts_file.py", "script": "run", "parser": "create_parser", "help": "Output a hosts file to stdout", "virtualenv": false},
"make-tasks": {"path": "taskgraph.py", "script": "run", "parser": "get_parser", "parse_known": true, "help": "Generate taskcluster.yml file containing the run tasks",
"virtualenv": true, "install": ["pyyaml"]}
}

View file

@ -0,0 +1,123 @@
import argparse
import copy
import os
import six
import yaml
here = os.path.dirname(__file__)
wpt_root = os.path.abspath(os.path.join(here, os.pardir, os.pardir))
task_template = {
"provisionerId": "{{ taskcluster.docker.provisionerId }}",
"workerType": "{{ taskcluster.docker.workerType }}",
"extra": {
"github": {
"events": ["push"],
"branches": ["master"],
},
},
"payload": {
"maxRunTime": 5400,
"image": "harjgam/web-platform-tests:0.6",
"command":[
"/bin/bash",
"--login",
"-c",
""">-
~/start.sh &&
cd /home/test/web-platform-tests &&
git fetch {{event.head.repo.url}} &&
git config advice.detachedHead false &&
git checkout {{event.head.sha}} &&
%(command)s"""],
"artifacts": {
"public/results": {
"path": "/home/test/artifacts",
"type": "directory"
}
}
},
"metadata": {
"name": "wpt-%(browser_name)s-%(suite)s-%(chunk)s",
"description": "",
"owner": "{{ event.head.user.email }}",
"source": "{{ event.head.repo.url }}",
}
}
file_template = {
"version": 0,
"tasks": [],
"allowPullRequests": "collaborators"
}
suites = {
"testharness": {"chunks": 12},
"reftest": {"chunks": 6},
"wdspec": {"chunks": 1}
}
browsers = {
"firefox": {"name": "firefox-nightly"},
"chrome": {"name": "chrome-dev"}
}
def get_parser():
parser = argparse.ArgumentParser()
parser.add_argument("--dest",
action="store",
default=wpt_root,
help="Directory to write the .taskcluster.yml file to")
return parser
def fill(template, data):
rv = {}
for key, value in template.iteritems():
rv[key] = fill_inner(value, data)
return rv
def fill_inner(value, data):
if isinstance(value, six.string_types):
return value % data
elif isinstance(value, dict):
return fill(value, data)
elif isinstance(value, list):
return [fill_inner(item, data) for item in value]
elif isinstance(value, (float,) + six.integer_types):
return value
else:
raise ValueError
def run(venv, *args, **kwargs):
if not os.path.isdir(kwargs["dest"]):
raise ValueError("Invalid directory %s" % kwargs["dest"])
task_config = copy.deepcopy(file_template)
for browser, browser_props in browsers.iteritems():
for suite, suite_props in suites.iteritems():
total_chunks = suite_props.get("chunks", 1)
for chunk in six.moves.xrange(1, total_chunks + 1):
data = {
"suite": suite,
"chunk": chunk,
"browser_name": browser_props["name"],
"command": ("./tools/ci/ci_taskcluster.sh %s %s %s %s" %
(browser, suite, chunk, total_chunks))
}
task_data = fill(task_template, data)
task_config["tasks"].append(task_data)
with open(os.path.join(kwargs["dest"], ".taskcluster.yml"), "w") as f:
f.write("""# GENERATED FILE DO NOT EDIT
# To regenerate this file run ./wpt make-tasks
""")
yaml.dump(task_config, f)