Skip to content

Commit

Permalink
Merge #588
Browse files Browse the repository at this point in the history
588: ci: Allow skipping tests when running under CI r=asomers
This adds `--cfg=travis` to builds under CI, allowing tests to be
conditionally ignored by marking them with

    #[cfg_attr(travis, ignore)]

refs #568
  • Loading branch information
bors[bot] committed Apr 17, 2017
2 parents 2f780ef + 25ce053 commit 3095f77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
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

0 comments on commit 3095f77

Please sign in to comment.