Skip to content

Commit

Permalink
Add triggers/* branches to support triggering full runs (#18870)
Browse files Browse the repository at this point in the history
Handle empty list of commits in `get_extra_jobs`, since that's possible when force pushing.

Fixes #13263.
  • Loading branch information
foolip authored Sep 5, 2019
1 parent af74d60 commit d86745d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ jobs:
displayName: 'all tests: Edge Dev'
condition: |
or(eq(variables['Build.SourceBranch'], 'refs/heads/epochs/six_hourly'),
eq(variables['Build.SourceBranch'], 'refs/heads/triggers/edge_dev'),
and(eq(variables['Build.Reason'], 'Manual'), variables['run_all_edge_dev']))
strategy:
parallel: 10 # chosen to make runtime ~2h
Expand Down Expand Up @@ -271,6 +272,7 @@ jobs:
displayName: 'all tests: Edge Canary'
condition: |
or(eq(variables['Build.SourceBranch'], 'refs/heads/epochs/six_hourly'),
eq(variables['Build.SourceBranch'], 'refs/heads/triggers/edge_canary'),
and(eq(variables['Build.Reason'], 'Manual'), variables['run_all_edge_canary']))
strategy:
parallel: 10 # chosen to make runtime ~2h
Expand Down Expand Up @@ -306,6 +308,7 @@ jobs:
displayName: 'all tests: Safari'
condition: |
or(eq(variables['Build.SourceBranch'], 'refs/heads/epochs/daily'),
eq(variables['Build.SourceBranch'], 'refs/heads/triggers/safari_stable'),
and(eq(variables['Build.Reason'], 'Manual'), variables['run_all_safari']))
strategy:
parallel: 5 # chosen to make runtime ~2h
Expand Down Expand Up @@ -340,6 +343,7 @@ jobs:
displayName: 'all tests: Safari Technology Preview'
condition: |
or(eq(variables['Build.SourceBranch'], 'refs/heads/epochs/six_hourly'),
eq(variables['Build.SourceBranch'], 'refs/heads/triggers/safari_preview'),
and(eq(variables['Build.Reason'], 'Manual'), variables['run_all_safari_preview']))
strategy:
parallel: 5 # chosen to make runtime ~2h
Expand Down
8 changes: 7 additions & 1 deletion .taskcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ tasks:
$match: {
event.ref == "refs/heads/master": [{name: firefox, channel: nightly}, {name: chrome, channel: dev}],
event.ref == "refs/heads/epochs/daily": [{name: firefox, channel: stable}, {name: chrome, channel: stable}],
event.ref == "refs/heads/epochs/weekly": [{name: firefox, channel: beta}, {name: chrome, channel: beta}]
event.ref == "refs/heads/epochs/weekly": [{name: firefox, channel: beta}, {name: chrome, channel: beta}],
event.ref == "refs/heads/triggers/chrome_stable": [{name: chrome, channel: stable}],
event.ref == "refs/heads/triggers/chrome_beta": [{name: chrome, channel: beta}],
event.ref == "refs/heads/triggers/chrome_dev": [{name: chrome, channel: dev}],
event.ref == "refs/heads/triggers/firefox_stable": [{name: firefox, channel: stable}],
event.ref == "refs/heads/triggers/firefox_beta": [{name: firefox, channel: beta}],
event.ref == "refs/heads/triggers/firefox_nightly": [{name: firefox, channel: nightly}]
}
each(browser):
$map:
Expand Down
32 changes: 32 additions & 0 deletions docs/running-tests/from-ci.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Running Tests on CI

Contributors with write access to the repository can trigger full runs in the
same CI systems used to produce results for [wpt.fyi](https://wpt.fyi). The runs
are triggered by pushing to branch names on the form `triggers/$browser_$channel`
and the results will be automatically submitted to wpt.fyi.

This is useful when making infrastructure changes that could affect very many
tests, in order to avoid regressions.

Note: Full runs use a lot of CI resources, so please take care to not trigger
them more than necessary.

Instructions:

* Base your changes on a commit for which there are already results in wpt.fyi.

* Determine which branch name to push to by looking for `refs/heads/triggers/`
in `.azure-pipelines.yml` and `.taskcluster.yml`. For example, to trigger a
full run of Safari Technology Preview, the branch name is
`triggers/safari_preview`.

* Force push to the branch, for example:
`git push --force-with-lease origin HEAD:triggers/safari_preview`.
The `--force-with-lease` argument is to detect if someone else has just
pushed. When this happens wait for the checkout step of their triggered run
to finish before you force push again.

You can see if the run started from the commit status on GitHub's commits listing
([example](https://github.com/web-platform-tests/wpt/commits/triggers/safari_preview))
and if successful the results will show up on wpt.fyi within 10 minutes
([example](https://wpt.fyi/runs?product=safari)).
4 changes: 4 additions & 0 deletions docs/running-tests/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from-web
from-local-system
from-ci
custom-runner
../tools/certs/README.md
```
Expand All @@ -15,6 +16,9 @@ that approach is available in [Running tests from the Web](from-web).
Contributors who are interested in modifying and creating tests should refer to
[Running Tests from the Local System](from-local-system).

Contributors with write access to the repository can also trigger full runs
in our CI setups, see [Running Tests on CI](from-ci).

Advanced use cases may call for a customized method of executing the tests.
Guidelines for writing a custom "runner" are available at [Writing Your Own
Runner](custom-runner).
2 changes: 1 addition & 1 deletion tools/ci/run_tc.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def start_xvfb():
def get_extra_jobs(event):
body = None
jobs = set()
if "commits" in event:
if "commits" in event and event["commits"]:
body = event["commits"][0]["message"]
elif "pull_request" in event:
body = event["pull_request"]["body"]
Expand Down

0 comments on commit d86745d

Please sign in to comment.