Merge pull request #3145 from otavio/allow-failure-for-crater

CI: only run unit tests for `crater`
This commit is contained in:
Nick Cameron 2018-11-02 10:08:39 +13:00 committed by GitHub
commit b8a133d432
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 8 deletions

View file

@ -35,8 +35,6 @@ matrix:
- env: INTEGRATION=stdsimd - env: INTEGRATION=stdsimd
- env: INTEGRATION=tempdir - env: INTEGRATION=tempdir
allow_failures: allow_failures:
# Doesn't build
- env: INTEGRATION=futures-rs
# Doesn't build - seems to be because of an option # Doesn't build - seems to be because of an option
- env: INTEGRATION=packed_simd - env: INTEGRATION=packed_simd
# Test failure # Test failure

View file

@ -24,9 +24,25 @@ cargo fmt -- --version
# #
# * `cargo fmt --all` succeeds without any warnings or errors # * `cargo fmt --all` succeeds without any warnings or errors
# * `cargo fmt --all -- --check` after formatting returns success # * `cargo fmt --all -- --check` after formatting returns success
# * `cargo test -all` still passes (formatting did not break the build) # * `cargo test --all` still passes (formatting did not break the build)
function check_fmt { function check_fmt_with_all_tests {
cargo test --all check_fmt_base "--all"
return $?
}
# Checks that:
#
# * `cargo fmt --all` succeeds without any warnings or errors
# * `cargo fmt --all -- --check` after formatting returns success
# * `cargo test --lib` still passes (formatting did not break the build)
function check_fmt_with_lib_tests {
check_fmt_base "--lib"
return $?
}
function check_fmt_base {
local test_args="$1"
cargo test $test_args
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
return 0 return 0
fi fi
@ -54,7 +70,7 @@ function check_fmt {
cat rustfmt_check_output cat rustfmt_check_output
return 1 return 1
fi fi
cargo test --all cargo test $test_args
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
return $? return $?
fi fi
@ -65,13 +81,19 @@ case ${INTEGRATION} in
git clone --depth=1 https://github.com/rust-lang/${INTEGRATION}.git git clone --depth=1 https://github.com/rust-lang/${INTEGRATION}.git
cd ${INTEGRATION} cd ${INTEGRATION}
export CFG_DISABLE_CROSS_TESTS=1 export CFG_DISABLE_CROSS_TESTS=1
check_fmt check_fmt_with_all_tests
cd -
;;
crater)
git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git
cd ${INTEGRATION}
check_fmt_with_lib_tests
cd - cd -
;; ;;
*) *)
git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git
cd ${INTEGRATION} cd ${INTEGRATION}
check_fmt check_fmt_with_all_tests
cd - cd -
;; ;;
esac esac