summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2017-04-17 16:09:59 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2017-04-17 16:09:59 +0000
commit3095f77e46a7563dbc8ce5cd2ad80846e43c2e63 (patch)
tree45e4f7cae290d2062b1d52ab0cf376865ad9890a
parent2f780ef0052587415e2a3dfe934acc0e30eebee0 (diff)
parent25ce053a2d42a94bcc2c27883eb81c2fe45e5a69 (diff)
downloadnix-3095f77e46a7563dbc8ce5cd2ad80846e43c2e63.zip
Merge #588
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
-rw-r--r--CONTRIBUTING.md7
-rw-r--r--ci/script.sh5
2 files changed, 12 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8d8b8ded..03a1f630 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -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
diff --git a/ci/script.sh b/ci/script.sh
index 39c3aeec..df61c35a 100644
--- a/ci/script.sh
+++ b/ci/script.sh
@@ -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