Table of Contents
FIXME: FILL ME IN!
In order for the Swift project to be able to advance quickly, it is important that we maintain a green build [1]. In order to help maintain this green build, the Swift project heavily uses pull request (PR) testing. Specifically, an important general rule is that all non-trivial checkins to any Swift Project repository should should at least perform a smoke test if simulators will not be impacted or a full validation test if simulators may be impacted. If in addition one is attempting to make a source breaking change across multiple repositories one should follow the cross repo source breaking changes workflow. We now continue by describing the Swift system for Pull Request testing, @swift-ci:
Users with commit access can trigger pull request testing by writing a comment on a PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment used. The current test types are:
We describe each in detail below:
Platform | Comment | Check Status |
---|---|---|
All supported platforms | @swift-ci Please smoke test | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) |
All supported platforms | @swift-ci Please clean smoke test | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) |
All supported platforms | @swift-ci Please smoke test and merge | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) |
All supported platforms | @swift-ci Please clean smoke test and merge | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) |
macOS platform | @swift-ci Please smoke test OS X platform | Swift Test OS X Platform (smoke test) |
macOS platform | @swift-ci Please clean smoke test OS X platform | Swift Test OS X Platform (smoke test) |
Linux platform | @swift-ci Please smoke test Linux platform | Swift Test Linux Platform (smoke test) |
Linux platform | @swift-ci Please clean smoke test Linux platform | Swift Test Linux Platform (smoke test) |
A smoke test on macOS does the following:
A smoke test on Linux does the following:
Platform | Comment | Check Status |
---|---|---|
All supported platforms | @swift-ci Please test | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) Swift Test Linux Platform Swift Test OS X Platform |
All supported platforms | @swift-ci Please clean test | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) Swift Test Linux Platform Swift Test OS X Platform |
All supported platforms | @swift-ci Please test and merge | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) Swift Test Linux Platform Swift Test OS X Platform |
All supported platforms | @swift-ci Please clean test and merge | Swift Test Linux Platform (smoke test) Swift Test OS X Platform (smoke test) Swift Test Linux Platform Swift Test OS X Platform |
macOS platform | @swift-ci Please test OS X platform | Swift Test OS X Platform (smoke test) Swift Test OS X Platform |
macOS platform | @swift-ci Please clean test OS X platform | Swift Test OS X Platform (smoke test) Swift Test OS X Platform |
macOS platform | @swift-ci Please benchmark | Swift Benchmark on OS X Platform (many runs - rigorous) |
macOS platform | @swift-ci Please smoke benchmark | Swift Benchmark on OS X Platform (few runs - sanity) |
Linux platform | @swift-ci Please test Linux platform | Swift Test Linux Platform (smoke test) Swift Test Linux Platform |
Linux platform | @swift-ci Please clean test Linux platform | Swift Test Linux Platform (smoke test) Swift Test Linux Platform |
macOS platform | @swift-ci Please ASAN test | Swift ASAN Test OS X Platform |
The core principles of validation testing is that:
With that being said, a validation test on macOS does the following:
A validation test on Linux does the following:
Platform | Comment | Check Status |
---|---|---|
macOS platform | @swift-ci Please benchmark | Swift Benchmark on OS X Platform (many runs - rigorous) |
macOS platform | @swift-ci Please smoke benchmark | Swift Benchmark on OS X Platform (few runs - sanity) |
Language | Comment | What it Does | Corresponding Local Command |
---|---|---|---|
Python | @swift-ci Please Python lint | Lints Python sources | ./utils/python_lint.py |
Platform | Comment | Check Status |
---|---|---|
macOS platform | @swift-ci Please Test Source Compatibility | Swift Source Compatibility Suite on macOS Platform |
Platform | Comment | Check Status |
---|---|---|
macOS platform | preset= @swift-ci Please test macOS with preset | Swift Test macOS Platform with preset |
For example:
preset=buildbot_incremental,tools=RA,stdlib=RD,smoketest=macosx,single-thread @swift-ci Please test macOS with preset
Platform | Comment | Check Status |
---|---|---|
macOS platform | @swift-ci Please test compiler performance | Compiles full source compatibility test suite and measures compiler performance |
macOS platform | @swift-ci Please smoke test compiler performance | Compiles a subset of source compatibility test suite and measures compiler performance |
These commands will:
For the detailed explanation of how compiler performance is measured, please refer to this document.
Simply provide the URL from corresponding pull requests in the same comment as “@swift-ci Please test” phrase. List all of the pull requests and then provide the specific test phrase you would like to trigger. Currently, it will only merge the main pull request you requested testing from as opposed to all of the PR's.
For example:
Please test with following pull request: https://github.com/apple/swift/pull/4574 @swift-ci Please test Linux platform
Please test with following PR: https://github.com/apple/swift-lldb/pull/48 https://github.com/apple/swift-package-manager/pull/632 @swift-ci Please test macOS platform
apple/swift-lldb#48 @swift-ci Please test Linux platform
Create a separate PR for each repository that needs to be changed. Each should reference the main Swift PR and create a reference to all of the others from the main PR.
Gate all commits on @swift-ci smoke test and merge. As stated above, it is important that all checkins perform PR testing since if breakage enters the tree PR testing becomes less effective. If you have done local testing (using build-toolchain) and have made appropriate changes to the other repositories then perform a smoke test and merge should be sufficient for correctness. This is not meant to check for correctness in your commits, but rather to be sure that no one landed changes in other repositories or in swift that cause your PR to no longer be correct. If you were unable to make workarounds to the other repositories, this smoke test will break after Swift has built. Check the log to make sure that it is the expected failure for that platform/repository that coincides with the failure your PR is supposed to fix.
Merge all of the pull requests simultaneously.
Watch the public incremental build on ci.swift.org to make sure that you did not make any mistakes. It should complete within 30-40 minutes depending on what else was being committed in the mean time.
FIXME: FILL ME IN!
[1] Even though it should be without saying, the reason why having a green build is important is that:
[2] This is due to unrelated issues relating to running lldb tests on macOS.