Fix and tweak integration tests

This commit is contained in:
Nick Cameron 2018-05-18 17:38:30 +12:00
parent b0eb899324
commit 89f453ceba
2 changed files with 20 additions and 33 deletions

View File

@ -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:
- |

View File

@ -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