From aacebc854a7b94e2102eeda1b717452162877b06 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Fri, 15 Jun 2018 14:20:39 +0200 Subject: [PATCH 1/6] test cargo fmt --all -- --check returns success after formatting --- ci/integration.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ci/integration.sh b/ci/integration.sh index 0bce1671d4ee..39fb3b11ade3 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -20,6 +20,11 @@ cargo install --force echo "Integration tests for: ${INTEGRATION}" cargo fmt -- --version +# Checks that: +# +# * `cargo fmt --all` succeeds without any warnings or errors +# * `cargo test -all` still passes (formatting did not break the build) +# * `cargo fmt --all -- --check` after formatting returns success function check_fmt { touch rustfmt.toml cargo fmt --all -v 2>&1 | tee rustfmt_output @@ -44,6 +49,12 @@ function check_fmt { if [[ $? != 0 ]]; then return $? fi + + cargo fmt --all -- --check 2>&1 | tee rustfmt_check_output + if [[ $? != 0 ]]; then + cat rustfmt_check_output + return 1 + fi } case ${INTEGRATION} in From 88a2c48ce3ba89220fd601994a4afab39412ba83 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Fri, 15 Jun 2018 15:07:32 +0200 Subject: [PATCH 2/6] preserve pipe error status (tee always succeeds); check fmt before running tests --- ci/integration.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/ci/integration.sh b/ci/integration.sh index 39fb3b11ade3..4f80207599fa 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -23,12 +23,12 @@ cargo fmt -- --version # Checks that: # # * `cargo fmt --all` succeeds without any warnings or errors -# * `cargo test -all` still passes (formatting did not break the build) # * `cargo fmt --all -- --check` after formatting returns success +# * `cargo test -all` still passes (formatting did not break the build) function check_fmt { touch rustfmt.toml cargo fmt --all -v 2>&1 | tee rustfmt_output - if [[ $? != 0 ]]; then + if [[ ${PIPESTATUS[0]} != 0 ]]; then cat rustfmt_output return 1 fi @@ -45,16 +45,15 @@ function check_fmt { if [[ $? != 0 ]]; then return 1 fi + cargo fmt --all -- --check 2>&1 | tee rustfmt_check_output + if [[ ${PIPESTATUS[0]} != 0 ]]; then + cat rustfmt_check_output + return 1 + fi cargo test --all if [[ $? != 0 ]]; then return $? fi - - cargo fmt --all -- --check 2>&1 | tee rustfmt_check_output - if [[ $? != 0 ]]; then - cat rustfmt_check_output - return 1 - fi } case ${INTEGRATION} in From 3b65e159897046699ffc7c8f75b452123c21d473 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 18 Jun 2018 09:49:17 +0200 Subject: [PATCH 3/6] update issues; allow stdsimd to fail --- .travis.yml | 5 +++-- ci/integration.sh | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1be31d67f4f..b7118865a0dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,10 +31,9 @@ matrix: - env: INTEGRATION=rand - env: INTEGRATION=rust-clippy - env: INTEGRATION=rust-semverver - - env: INTEGRATION=stdsimd - env: INTEGRATION=tempdir allow_failures: - # Need to run an lalrpop build step before testing? + # See: https://github.com/rust-lang-nursery/rustfmt/issues/2789 - env: INTEGRATION=chalk # PR sent - env: INTEGRATION=crater @@ -44,6 +43,8 @@ matrix: - env: INTEGRATION=rust-clippy # Doesn't build - env: INTEGRATION=rust-semverver + # See: https://github.com/rust-lang-nursery/rustfmt/issues/2787 + - env: INTEGRATION=stdsimd before_script: - | diff --git a/ci/integration.sh b/ci/integration.sh index 4f80207599fa..461effbf557b 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -27,7 +27,7 @@ cargo fmt -- --version # * `cargo test -all` still passes (formatting did not break the build) function check_fmt { touch rustfmt.toml - cargo fmt --all -v 2>&1 | tee rustfmt_output + cargo fmt --all -v |& tee rustfmt_output if [[ ${PIPESTATUS[0]} != 0 ]]; then cat rustfmt_output return 1 @@ -45,7 +45,7 @@ function check_fmt { if [[ $? != 0 ]]; then return 1 fi - cargo fmt --all -- --check 2>&1 | tee rustfmt_check_output + cargo fmt --all -- --check |& tee rustfmt_check_output if [[ ${PIPESTATUS[0]} != 0 ]]; then cat rustfmt_check_output return 1 From 968bcad42284c7b7be176f17a058a61af1648911 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 18 Jun 2018 09:50:20 +0200 Subject: [PATCH 4/6] rust-semverver build properly --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7118865a0dd..21dfc6c7bec2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,8 +41,6 @@ matrix: - env: INTEGRATION=rand # Doesn't build - env: INTEGRATION=rust-clippy - # Doesn't build - - env: INTEGRATION=rust-semverver # See: https://github.com/rust-lang-nursery/rustfmt/issues/2787 - env: INTEGRATION=stdsimd From dda964d0be87ebc9e697ea47e19dbc90149cb094 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 18 Jun 2018 10:04:21 +0200 Subject: [PATCH 5/6] fix chalk build --- ci/integration.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ci/integration.sh b/ci/integration.sh index 461effbf557b..c8425dd547cc 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -64,6 +64,15 @@ case ${INTEGRATION} in check_fmt cd - ;; + chalk) + git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git + cd ${INTEGRATION} + # Need to run build.rs once. + # See: https://github.com/rust-lang-nursery/rustfmt/issues/2789 + cargo build + check_fmt + cd - + ;; failure) git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git cd ${INTEGRATION}/failure-1.X From cf1164ee7d100dc59de2a19e5ad046cd3c4ed699 Mon Sep 17 00:00:00 2001 From: gnzlbg Date: Mon, 18 Jun 2018 10:43:07 +0200 Subject: [PATCH 6/6] do not fix chalk --- ci/integration.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ci/integration.sh b/ci/integration.sh index c8425dd547cc..461effbf557b 100755 --- a/ci/integration.sh +++ b/ci/integration.sh @@ -64,15 +64,6 @@ case ${INTEGRATION} in check_fmt cd - ;; - chalk) - git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git - cd ${INTEGRATION} - # Need to run build.rs once. - # See: https://github.com/rust-lang-nursery/rustfmt/issues/2789 - cargo build - check_fmt - cd - - ;; failure) git clone --depth=1 https://github.com/rust-lang-nursery/${INTEGRATION}.git cd ${INTEGRATION}/failure-1.X