From 89f453cebad646868e7dcb4e7f657afdba0da509 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 18 May 2018 17:38:30 +1200 Subject: [PATCH] Fix and tweak integration tests --- .travis.yml | 29 +++++++++++++---------------- ci/integration.sh | 24 +++++++----------------- 2 files changed, 20 insertions(+), 33 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8eef98030de4..2c82af7d2188 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,11 +19,10 @@ matrix: - env: CFG_RELEASE_CHANNEL=beta - os: osx - env: INTEGRATION=cargo + - env: INTEGRATION=chalk - env: INTEGRATION=rust-clippy - env: INTEGRATION=mdbook - env: INTEGRATION=stdsimd - - env: INTEGRATION=rust-semverver - - env: INTEGRATION=chalk - env: INTEGRATION=crater - env: INTEGRATION=futures-rs - env: INTEGRATION=rand @@ -31,22 +30,20 @@ matrix: - env: INTEGRATION=error-chain - env: INTEGRATION=bitflags - env: INTEGRATION=log - allow_failures: - - env: INTEGRATION=cargo - - env: INTEGRATION=stdsimd - - env: INTEGRATION=mdbook - - env: INTEGRATION=crater - - env: INTEGRATION=rust-semverver - - env: INTEGRATION=rust-clippy - - env: INTEGRATION=chalk - - env: INTEGRATION=bitflags - - env: INTEGRATION=error-chain - - env: INTEGRATION=failure - - env: INTEGRATION=futures-rs - - env: INTEGRATION=log - - env: INTEGRATION=rand - env: INTEGRATION=glob - env: INTEGRATION=tempdir + - env: INTEGRATION=rust-semverver + allow_failures: + # PR sent + - env: INTEGRATION=crater + # #2721 + - env: INTEGRATION=rand + # dues to a test failure (fails before Rustfmt'ing too) + - env: INTEGRATION=stdsimd + # Need to run an lalrpop build step before testing? + - env: INTEGRATION=chalk + # Doesn't build + - env: INTEGRATION=rust-semverver before_script: - | diff --git a/ci/integration.sh b/ci/integration.sh index 74e7c397a805..0bce1671d4ee 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -4,8 +4,7 @@ set -ex : ${INTEGRATION?"The INTEGRATION environment variable must be set."} -# FIXME: this is causing the build to fail when rustfmt is found in .cargo/bin -# but cargo-fmt is not found. +# FIXME: this means we can get a stale cargo-fmt from a previous run. # # `which rustfmt` fails if rustfmt is not found. Since we don't install # `rustfmt` via `rustup`, this is the case unless we manually install it. Once @@ -15,12 +14,14 @@ set -ex # here after the first installation will find `rustfmt` and won't need to build # it again. # -# which rustfmt || cargo install --force +#which cargo-fmt || cargo install --force cargo install --force echo "Integration tests for: ${INTEGRATION}" +cargo fmt -- --version function check_fmt { + touch rustfmt.toml cargo fmt --all -v 2>&1 | tee rustfmt_output if [[ $? != 0 ]]; then cat rustfmt_output @@ -45,35 +46,24 @@ function check_fmt { fi } -function check { - cargo test --all - if [[ $? != 0 ]]; then - return 1 - fi - check_fmt - if [[ $? != 0 ]]; then - return 1 - fi -} - case ${INTEGRATION} in cargo) git clone --depth=1 https://github.com/rust-lang/${INTEGRATION}.git cd ${INTEGRATION} export CFG_DISABLE_CROSS_TESTS=1 - check + check_fmt cd - ;; failure) git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git cd ${INTEGRATION}/failure-1.X - check + check_fmt cd - ;; *) git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git cd ${INTEGRATION} - check + check_fmt cd - ;; esac