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

PARTIAL: Begin pull request task #3

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
8ef57a5
[tools] Use more descriptive script name
jugglinmike Aug 7, 2018
f7f3019
[tools] Generalize repository cloning procedure
jugglinmike Aug 7, 2018
2466423
TEMPORARY Use de-privileged worker type
jugglinmike Aug 7, 2018
71e3c10
Refactor
jugglinmike Aug 7, 2018
f687d73
Try to get TaskCluster to fetch new image
jugglinmike Aug 8, 2018
a4afafe
Just use a new tag
jugglinmike Aug 8, 2018
9f42fe5
Correct fetch command
jugglinmike Aug 8, 2018
8a22600
Fix things
jugglinmike Aug 8, 2018
56bae6c
PARTIAL: Begin pull request task
jugglinmike Aug 8, 2018
d9640c5
Correct array generation
jugglinmike Aug 14, 2018
e7c34f1
Correct task name
jugglinmike Aug 14, 2018
c37e6d2
Correct event reference
jugglinmike Aug 14, 2018
4c90457
Correct invocation of provisioning script
jugglinmike Aug 14, 2018
9859d25
Correct "owner" e-mail (as per TaskCluster docs)
jugglinmike Aug 14, 2018
a190a95
Modify a test
jugglinmike Aug 14, 2018
03a8732
Refactor
jugglinmike Aug 15, 2018
225001f
Corret task IDs
jugglinmike Aug 15, 2018
aeca034
Correct command
jugglinmike Aug 15, 2018
20885b2
Lazy commit message
jugglinmike Aug 15, 2018
ef19dee
Integrate new feature
jugglinmike Aug 16, 2018
49127dd
Restructure artifact specification
jugglinmike Aug 16, 2018
6c157a1
Refactor artifact specification
jugglinmike Aug 16, 2018
bb16643
Add debugging statements
jugglinmike Aug 16, 2018
15d9a3b
Correct URL reference
jugglinmike Aug 16, 2018
dd62edd
Remove parameterized parameters
jugglinmike Aug 16, 2018
3ae5013
Correct command formatting
jugglinmike Aug 16, 2018
b28d491
Truly correct command formatting
jugglinmike Aug 16, 2018
c839b5c
Specify base revision
jugglinmike Aug 17, 2018
72408a6
Inspect command output
jugglinmike Aug 17, 2018
9caed66
Ensure base revision is available
jugglinmike Aug 17, 2018
2901c0d
Restructure code retrieval logic
jugglinmike Aug 20, 2018
6f788bb
Add statement delimiters
jugglinmike Aug 20, 2018
79bdc96
Specify URL of git remote
jugglinmike Aug 20, 2018
8f17efc
Refactor
jugglinmike Aug 20, 2018
de7af72
Disable builds for GitHub push events
jugglinmike Aug 20, 2018
a75cd46
Escape escape
jugglinmike Aug 20, 2018
af1f51b
Reformat
jugglinmike Aug 20, 2018
bbf61eb
Correct syntax
jugglinmike Aug 20, 2018
6a3a995
Correct argument ordering
jugglinmike Aug 20, 2018
c2dcd4f
Download manifest file
jugglinmike Aug 20, 2018
c7712d6
Introduce instability
jugglinmike Aug 20, 2018
a02cc9e
Revert to original "start" script
jugglinmike Aug 21, 2018
5f12938
Only attempt to gzip files that are present
jugglinmike Aug 21, 2018
4d9ba3a
Reformat
jugglinmike Aug 21, 2018
87ce5f3
Correct browser detection logic
jugglinmike Aug 21, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 120 additions & 53 deletions .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,76 +2,143 @@ version: 1
policy:
pullRequests: collaborators
tasks:
$if: tasks_for == "github-push"
then:
$if: event.ref == "refs/heads/master"
then:
$flattenDeep:
$flattenDeep:
- $if: tasks_for == "skip for now"
then:
$if: event.ref == "refs/heads/master"
then:
$map: [{name: firefox, channel: nightly}, {name: chrome, channel: dev}]
each(browser):
$map:
- [testharness, 1, 15]
- [testharness, 2, 15]
- [testharness, 3, 15]
- [testharness, 4, 15]
- [testharness, 5, 15]
- [testharness, 6, 15]
- [testharness, 7, 15]
- [testharness, 8, 15]
- [testharness, 9, 15]
- [testharness, 10, 15]
- [testharness, 11, 15]
- [testharness, 12, 15]
- [testharness, 13, 15]
- [testharness, 14, 15]
- [testharness, 15, 15]
- [reftest, 1, 10]
- [reftest, 2, 10]
- [reftest, 3, 10]
- [reftest, 4, 10]
- [reftest, 5, 10]
- [reftest, 6, 10]
- [reftest, 7, 10]
- [reftest, 8, 10]
- [reftest, 9, 10]
- [reftest, 10, 10]
- [wdspec, 1, 1]
each(chunk):
taskId: {$eval: 'as_slugid(browser.name + browser.channel + chunk[0] + str(chunk[1]))'}
taskGroupId: {$eval: 'as_slugid("task group")'}
created: {$fromNow: ''}
deadline: {$fromNow: '24 hours'}
provisionerId: aws-provisioner-v1
# Contributors interested in configurating TaskCluster to run
# against their fork of WPT should change the `workerType` to
# "github-worker".
workerType: github-worker
metadata:
name: wpt-${browser.name}-${browser.channel}-${chunk[0]}-${chunk[1]}
description: >-
A subset of WPT's "${chunk[0]}" tests (chunk number ${chunk[1]}
of ${chunk[2]}), run in the ${browser.channel} release of
${browser.name}.
owner: ${event.pusher.email}
source: ${event.repository.url}
payload:
image: gsnedders/web-platform-tests:0.13
maxRunTime: 7200
artifacts:
public/results:
path: /home/test/artifacts
type: directory
command:
- /bin/bash
- --login
- -c
- set -ex;
~/start.sh
${event.repository.url}
${event.ref}
${event.after}
${browser.name}-${browser.channel};
cd ~/web-platform-tests;
./tools/ci/ci_taskcluster.sh
--test-type=${chunk[0]}
--this-chunk=${chunk[1]}
--total-chunks=${chunk[2]}
${browser.name};
- $if: tasks_for == "github-pull-request"
then:
$map: [{name: firefox, channel: nightly}, {name: chrome, channel: dev}]
each(browser):
$map:
- [testharness, 1, 15]
- [testharness, 2, 15]
- [testharness, 3, 15]
- [testharness, 4, 15]
- [testharness, 5, 15]
- [testharness, 6, 15]
- [testharness, 7, 15]
- [testharness, 8, 15]
- [testharness, 9, 15]
- [testharness, 10, 15]
- [testharness, 11, 15]
- [testharness, 12, 15]
- [testharness, 13, 15]
- [testharness, 14, 15]
- [testharness, 15, 15]
- [reftest, 1, 10]
- [reftest, 2, 10]
- [reftest, 3, 10]
- [reftest, 4, 10]
- [reftest, 5, 10]
- [reftest, 6, 10]
- [reftest, 7, 10]
- [reftest, 8, 10]
- [reftest, 9, 10]
- [reftest, 10, 10]
- [wdspec, 1, 1]
each(chunk):
taskId: {$eval: 'as_slugid(browser.name + browser.channel + chunk[0] + str(chunk[1]))'}
- name: wpt-${browser.name}-${browser.channel}-stability
description: >-
Verify that tests modified in a pull request are stable when
executed in ${browser.name}.
command:
echo $affected | base64 -d | xargs -0 ./tools/ci/ci_taskcluster.sh --verify ${browser.name}
creates_artifacts: false
- name: wpt-${browser.name}-${browser.channel}-results
description: >-
Collect results for modified tests in ${browser.name}.
command:
echo $affected | base64 -d | xargs -0 ./tools/ci/ci_taskcluster.sh ${browser.name}
creates_artifacts: true
each(operation):
taskId: {$eval: 'as_slugid(operation.name)'}
taskGroupId: {$eval: 'as_slugid("task group")'}
created: {$fromNow: ''}
deadline: {$fromNow: '24 hours'}
provisionerId: aws-provisioner-v1
# Contributors interested in configurating TaskCluster to run
# against their fork of WPT should change the `workerType` to
# "github-worker".
workerType: wpt-docker-worker
workerType: github-worker
metadata:
name: wpt-${browser.name}-${browser.channel}-${chunk[0]}-${chunk[1]}
description: >-
A subset of WPT's "${chunk[0]}" tests (chunk number ${chunk[1]}
of ${chunk[2]}), run in the ${browser.channel} release of
${browser.name}.
owner: ${event.pusher.email}
name: ${operation.name}
description: ${operation.description}
owner: ${event.pull_request.user.login}@users.noreply.github.com
source: ${event.repository.url}
payload:
image: gsnedders/web-platform-tests:0.13
maxRunTime: 7200
artifacts:
public/results:
path: /home/test/artifacts
type: directory
$if: operation.creates_artifacts
then:
public/results:
path: /home/test/artifacts
type: directory
command:
- /bin/bash
- --login
- -c
- "~/start.sh ${event.repository.url} ${event.ref[len('refs/heads/'):]} ${event.after} ${browser.name}-${browser.channel} &&
cd ~/web-platform-tests &&
./tools/ci/ci_taskcluster.sh ${browser.name} ${chunk[0]} ${chunk[1]} ${chunk[2]}"
else: []
# > NOTE: A well-designed template should produce `tasks: []` for any
# > unrecognized `task_for` values; this allows later expansion of this
# > service to handle more events.
#
# https://docs.taskcluster.net/docs/reference/integrations/taskcluster-github/docs/taskcluster-yml-v1
else: []
- set -ex;
~/start.sh
${event.repository.clone_url}
${event.pull_request.base.ref}
${event.pull_request.base.sha}
${browser.name}-${browser.channel};
cd ~/web-platform-tests;
./wpt manifest-download || true;
git fetch
${event.repository.clone_url}
refs/pull/${event.number}/head;
git checkout FETCH_HEAD;
affected=$(./wpt tests-affected
--null
${event.pull_request.base.sha}
| base64);
echo Affected tests:;
echo $affected | base64 -d | sed 's/\x0/\\n/g';
${operation.command}
4 changes: 4 additions & 0 deletions dom/events/CustomEvent.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_true(Math.random() > 0.5);
}, "Intentionally unstable test");

test(function() {
var type = "foo";

Expand Down
40 changes: 35 additions & 5 deletions tools/ci/ci_taskcluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,39 @@

./wpt manifest-download

if [ $1 == "firefox" ]; then
./wpt run firefox --log-tbpl=../artifacts/log_tbpl.log --log-tbpl-level=info --log-wptreport=../artifacts/wpt_report.json --log-mach=- --this-chunk=$3 --total-chunks=$4 --test-type=$2 -y --install-browser --no-pause --no-restart-on-unexpected --reftest-internal --install-fonts --no-fail-on-unexpected
elif [ $1 == "chrome" ]; then
./wpt run chrome --log-tbpl=../artifacts/log_tbpl.log --log-tbpl-level=info --log-wptreport=../artifacts/wpt_report.json --log-mach=- --this-chunk=$3 --total-chunks=$4 --test-type=$2 -y --no-pause --no-restart-on-unexpected --install-fonts --no-fail-on-unexpected
# The first script argument that is not prefixed with a dash (`-`) is assumed
# to be the name of the browser under test. This restricts the syntax available
# to consumers: value-accepting options must be specified using the equals sign
# (`=`).
for argument in $@; do
if [ ${argument:0:1} == '-' ]; then
continue
fi

browser_name=$arg

break
done

browser_specific_args=''

if [ $browser_name == 'firefox' ]; then
browser_specific_args='--install-browser --reftest-internal'
fi

./wpt run \
--log-tbpl=../artifacts/log_tbpl.log \
--log-tbpl-level=info \
--log-wptreport=../artifacts/wpt_report.json \
--log-mach=- \
-y \
--no-pause \
--no-restart-on-unexpected \
--install-fonts \
--no-fail-on-unexpected \
$browser_specific_args \
$@

if [ -f ../artifacts/wpt_report.json ]; then
gzip ../artifacts/wpt_report.json
fi
gzip ../artifacts/wpt_report.json
2 changes: 1 addition & 1 deletion tools/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ WORKDIR /home/test/

COPY .bashrc /home/test/.bashrc

COPY start.sh /home/test/start.sh
COPY provision.sh /home/test/provision.sh
Empty file modified tools/docker/start.sh
100755 → 100644
Empty file.