Skip to content

ci: Allow skipping tests when running under CI #588

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

Merged
merged 1 commit into from
Apr 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ locally. More information is available in the [CI Readme][ci-readme].
[travis-ci]: https://travis-ci.org/nix-rust/nix
[ci-readme]: ci/README.md

### Disabling a test in the CI environment

Sometimes there are features that cannot be tested in the CI environment.
To stop a test from running under CI, add `#[cfg_attr(travis, ignore)]`
to it. Please include a comment describing the reason it shouldn't run
under CI, and a link to an upstream issue if possible!

## bors, the bot who merges all the PRs

All pull requests are merged via [bors], an integration bot. After the
Expand Down
5 changes: 5 additions & 0 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
set -ex

main() {
# Add a cfg spec to allow disabling specific tests under CI.
if [ "$TRAVIS" = true ]; then
export RUSTFLAGS=--cfg=travis
fi

# Build debug and release targets
cross build --target $TARGET
cross build --target $TARGET --release
Expand Down