-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Validate pull requests in TaskCluster #12657
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
Changes from 4 commits
541acf3
c3f109b
a1f01d0
ee8d57d
7808fb1
0d6c2a2
c1792ee
f422774
150058e
0b623f3
30b4ae4
3371a4c
cbc779c
887512c
d9a12c3
80714c9
c4ea324
dba6e62
5c46835
e79a708
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,42 +2,110 @@ version: 1 | |
| policy: | ||
| pullRequests: collaborators | ||
| tasks: | ||
| $if: tasks_for == "github-push" | ||
| then: | ||
| $if: event.ref == "refs/heads/master" | ||
| then: | ||
| $flattenDeep: | ||
| $flattenDeep: | ||
| - $if: tasks_for == "github-push" | ||
| 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: wpt-docker-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: jugglinmike/web-platform-tests:0.18 | ||
| 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[len('refs/heads/'):]} | ||
| ${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 all tests affected by a pull request are stable | ||
| when executed in ${browser.name}. As of 2018-08-23, this task | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the extra text from the description; I don't think it's that helpful (we're more likely to forget to remove it later).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like there to be some contributor-facing indication of this behavior. |
||
| is being vetted for correctness, so its outcome will not | ||
| influence the status of the pull request. | ||
| command: | ||
| status=PASS; | ||
| echo $affected | | ||
| base64 -d | | ||
| xargs -0 ./tools/ci/ci_taskcluster.sh --verify ${browser.name} || status=FAIL; | ||
| echo $status > ../artifacts/stability-status.txt | ||
| creates_artifacts: true | ||
| - name: wpt-${browser.name}-${browser.channel}-results | ||
| description: >- | ||
| Collect results for all tests affected by a pull request 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'} | ||
|
|
@@ -47,31 +115,48 @@ tasks: | |
| # "github-worker". | ||
| workerType: wpt-docker-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 | ||
|
jgraham marked this conversation as resolved.
|
||
| source: ${event.repository.url} | ||
| payload: | ||
| image: gsnedders/web-platform-tests:0.13 | ||
| image: jugglinmike/web-platform-tests:0.18 | ||
| maxRunTime: 7200 | ||
| artifacts: | ||
| public/results: | ||
| path: /home/test/artifacts | ||
| type: directory | ||
| $if: operation.creates_artifacts | ||
| then: | ||
| public/results: | ||
| path: /home/test/artifacts | ||
| type: directory | ||
| # Bash removes null bytes from string values when set as | ||
| # environment variables. This invalidates the output of `wpt | ||
| # affected-tests` because it uses the null byte as a separator | ||
| # between test names. The list of effected tests is | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That should be |
||
| # Base64-encoded in order to preserve the null bytes. | ||
| 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 --wrap 0); | ||
| if [ -z $(echo $affected | base64 -d) ]; then | ||
| echo Zero tests affected.; | ||
| exit 0; | ||
| fi; | ||
| echo Affected tests:; | ||
| echo $affected | base64 -d | sed 's/\x0/\n/g'; | ||
| ${operation.command} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,9 +2,43 @@ | |
|
|
||
| ./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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like this exceeded my complexity threshold for a bash script. If we want a single entry point for all the things, let's make it a python script instead. |
||
| if [ ${argument:0:1} = '-' ]; then | ||
| continue | ||
| fi | ||
|
|
||
| browser_name=$argument | ||
|
|
||
| break | ||
| done | ||
|
|
||
| browser_specific_args='' | ||
|
|
||
| if [ $browser_name = 'firefox' ]; then | ||
| browser_specific_args='--install-browser --reftest-internal' | ||
| fi | ||
| gzip ../artifacts/wpt_report.json | ||
|
|
||
| ./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 \ | ||
| $@ | ||
|
|
||
| run_status=$? | ||
|
|
||
| if [ -f ../artifacts/wpt_report.json ]; then | ||
| gzip ../artifacts/wpt_report.json | ||
| fi | ||
|
|
||
| exit $run_status | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really need to set up a shared dockerhub account :)