From b869eeb2a451c8ae84d111e9885df4677c4f9446 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Mon, 21 Oct 2019 15:09:53 +0700 Subject: [PATCH 1/7] build: improve script and travis config * fix a diff failure on windows See https://travis-ci.com/rust-lang/rust-clippy/jobs/245971932#L1625 for an example. * use cmp instead of diff > /dev/null * clone single branch instead of clone then checking out * do not decrypt key if have no diff change --- .github/deploy.sh | 55 ++++++++++++-------------- .travis.yml | 37 ++++++----------- ci/base-tests.sh | 21 +++++----- tests/ui-toml/update-all-references.sh | 6 +-- tests/ui-toml/update-references.sh | 20 +++++----- tests/ui/update-all-references.sh | 6 +-- tests/ui/update-references.sh | 28 ++++++------- util/fetch_prs_between.sh | 13 +++--- 8 files changed, 85 insertions(+), 101 deletions(-) diff --git a/.github/deploy.sh b/.github/deploy.sh index a242c35c3aec..b82091592846 100755 --- a/.github/deploy.sh +++ b/.github/deploy.sh @@ -13,11 +13,7 @@ SSH_REPO=${REPO/https:\/\/github.com\//git@github.com:} SHA=$(git rev-parse --verify HEAD) # Clone the existing gh-pages for this repo into out/ -( - git clone "$REPO" out - cd out - git checkout $TARGET_BRANCH -) +git clone --quiet --single-branch --branch "$TARGET_BRANCH" "$REPO" out echo "Removing the current docs for master" rm -rf out/master/ || exit 0 @@ -27,7 +23,7 @@ mkdir out/master/ cp util/gh-pages/index.html out/master python ./util/export.py out/master/lints.json -if [ -n "$TRAVIS_TAG" ]; then +if [[ -n "$TRAVIS_TAG" ]]; then echo "Save the doc for the current tag ($TRAVIS_TAG) and point current/ to it" cp -r out/master "out/$TRAVIS_TAG" rm -f out/current @@ -35,27 +31,36 @@ if [ -n "$TRAVIS_TAG" ]; then fi # Generate version index that is shown as root index page -( - cp util/gh-pages/versions.html out/index.html - - cd out - python -c '\ - import os, json;\ - print json.dumps([\ - dir for dir in os.listdir(".")\ - if not dir.startswith(".") and os.path.isdir(dir)\ - ])' > versions.json -) +cp util/gh-pages/versions.html out/index.html +pushd out + +cat <<-EOF | python - > versions.json +import os, json +print json.dumps([ + dir for dir in os.listdir(".") if not dir.startswith(".") and os.path.isdir(dir) +]) +EOF +popd # Pull requests and commits to other branches shouldn't try to deploy, just build to verify -if [ "$TRAVIS_PULL_REQUEST" != "false" ] || [ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]; then +if [[ "$TRAVIS_PULL_REQUEST" != "false" ]] || [[ "$TRAVIS_BRANCH" != "$SOURCE_BRANCH" ]]; then # Tags should deploy - if [ -z "$TRAVIS_TAG" ]; then + if [[ -z "$TRAVIS_TAG" ]]; then echo "Generated, won't push" exit 0 fi fi +# Now let's go have some fun with the cloned repo +cd out +git config user.name "Travis CI" +git config user.email "travis@ci.invalid" + +if git diff --exit-code --quiet; then + echo "No changes to the output on this push; exiting." + exit 0 +fi + # Get the deploy key by using Travis's stored variables to decrypt deploy_key.enc ENCRYPTION_LABEL=e3a2d77100be ENCRYPTED_KEY_VAR="encrypted_${ENCRYPTION_LABEL}_key" @@ -64,19 +69,9 @@ ENCRYPTED_KEY=${!ENCRYPTED_KEY_VAR} ENCRYPTED_IV=${!ENCRYPTED_IV_VAR} openssl aes-256-cbc -K "$ENCRYPTED_KEY" -iv "$ENCRYPTED_IV" -in .github/deploy_key.enc -out .github/deploy_key -d chmod 600 .github/deploy_key -eval $(ssh-agent -s) +eval "$(ssh-agent -s)" ssh-add .github/deploy_key -# Now let's go have some fun with the cloned repo -cd out -git config user.name "Travis CI" -git config user.email "travis@ci.invalid" - -if [ -z "$(git diff --exit-code)" ]; then - echo "No changes to the output on this push; exiting." - exit 0 -fi - git add . git commit -m "Automatic deploy to GitHub Pages: ${SHA}" diff --git a/.travis.yml b/.travis.yml index 53af848a86d7..f707e622ad87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,6 @@ dist: xenial language: bash -os: - - linux - - osx - - windows - branches: # Don't build these branches except: @@ -34,13 +29,12 @@ install: if ! rustup component add rustfmt; then cargo install -Z install-upgrade --git https://github.com/rust-lang/rustfmt --bin rustfmt fi - if [ "$TRAVIS_OS_NAME" == "linux" ]; then + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then . $HOME/.nvm/nvm.sh nvm install stable nvm use stable npm install remark-cli remark-lint - fi - if [ "$TRAVIS_OS_NAME" == "windows" ]; then + elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then choco install windows-sdk-10.1 fi fi @@ -96,24 +90,19 @@ matrix: allow_failures: - os: windows env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true - # prevent these jobs with default env vars - exclude: - - os: linux - - os: osx - - os: windows before_script: - | - if [ "$TRAVIS_BRANCH" == "auto" ] || [ "$TRAVIS_BRANCH" == "try" ]; then - pr=$(echo $TRAVIS_COMMIT_MESSAGE | grep -o "#[0-9]*" | head -1 | sed 's/^#//g') - output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$pr" | \ + if [[ "$TRAVIS_BRANCH" == "auto" ]] || [[ "$TRAVIS_BRANCH" == "try" ]]; then + PR=$(echo "$TRAVIS_COMMIT_MESSAGE" | grep -o "#[0-9]*" | head -1 | sed 's/^#//g') + output=$(curl -H "Authorization: token $GITHUB_API_TOKEN" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \ python -c "import sys, json; print(json.load(sys.stdin)['body'])" | \ grep "^changelog: " | \ sed "s/changelog: //g") - if [ -z "$output" ]; then + if [[ -z "$output" ]]; then echo "ERROR: PR body must contain 'changelog: ...'" exit 1 - elif [ "$output" = "none" ]; then + elif [[ "$output" = "none" ]]; then echo "WARNING: changelog is 'none'" fi fi @@ -121,7 +110,7 @@ before_script: rm rust-toolchain ./setup-toolchain.sh - | - if [ "$TRAVIS_OS_NAME" == "windows" ]; then + if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export PATH=$PATH:$(rustc --print sysroot)/bin else export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib @@ -129,17 +118,17 @@ before_script: script: - | - if [ -z ${INTEGRATION} ]; then - travis_wait 30 ./ci/base-tests.sh && sleep 5 - else + if [[ -n ${INTEGRATION} ]]; then ./ci/integration-tests.sh && sleep 5 + else + travis_wait 30 ./ci/base-tests.sh && sleep 5 fi after_success: - | - if [ "$TRAVIS_OS_NAME" == "linux" ]; then + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then set -e - if [ -z ${INTEGRATION} ]; then + if [[ -z ${INTEGRATION} ]]; then ./.github/deploy.sh else echo "Not deploying, because we're in an integration test run" diff --git a/ci/base-tests.sh b/ci/base-tests.sh index d91d553147cd..3fe0f1745356 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -1,16 +1,18 @@ +#!/usr/bin/env bash set -ex echo "Running clippy base tests" PATH=$PATH:./node_modules/.bin -if [ "$TRAVIS_OS_NAME" == "linux" ]; then - remark -f *.md -f doc/*.md > /dev/null +if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + remark -f ./*.md -f doc/*.md > /dev/null fi # build clippy in debug mode and run tests cargo build --features "debugging deny-warnings" cargo test --features "debugging deny-warnings" # for faster build, share target dir between subcrates -export CARGO_TARGET_DIR=`pwd`/target/ +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR (cd clippy_lints && cargo test) (cd rustc_tools_util && cargo test) (cd clippy_dev && cargo test) @@ -29,26 +31,27 @@ export CARGO_TARGET_DIR=`pwd`/target/ ( # Check sysroot handling sysroot=$(./target/debug/clippy-driver --print sysroot) - test $sysroot = $(rustc --print sysroot) + test "$sysroot" = "$(rustc --print sysroot)" - if [ -z $OS_WINDOWS ]; then + if [[ -z "$OS_WINDOWS" ]]; then desired_sysroot=/tmp else desired_sysroot=C:/tmp fi sysroot=$(./target/debug/clippy-driver --sysroot $desired_sysroot --print sysroot) - test $sysroot = $desired_sysroot + test "$sysroot" = $desired_sysroot sysroot=$(SYSROOT=$desired_sysroot ./target/debug/clippy-driver --print sysroot) - test $sysroot = $desired_sysroot + test "$sysroot" = $desired_sysroot # Make sure this isn't set - clippy-driver should cope without it unset CARGO_MANIFEST_DIR # Run a lint and make sure it produces the expected output. It's also expected to exit with code 1 - # XXX How to match the clippy invocation in compile-test.rs? + # FIXME: How to match the clippy invocation in compile-test.rs? ! ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr - diff <(sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr) tests/ui/cstring.stderr + sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr > normalized.stderr + diff normalized.stderr tests/ui/cstring.stderr # TODO: CLIPPY_CONF_DIR / CARGO_MANIFEST_DIR ) diff --git a/tests/ui-toml/update-all-references.sh b/tests/ui-toml/update-all-references.sh index 71404b68c459..7028b251ea03 100755 --- a/tests/ui-toml/update-all-references.sh +++ b/tests/ui-toml/update-all-references.sh @@ -13,6 +13,6 @@ if [[ "$1" == "--help" || "$1" == "-h" ]]; then fi BUILD_DIR=$PWD/target/debug/test_build_base -MY_DIR=$(dirname $0) -cd $MY_DIR -find . -name '*.rs' | xargs ./update-references.sh $BUILD_DIR +MY_DIR=$(dirname "$0") +cd "$MY_DIR" || exit +find . -name '*.rs' -exec ./update-references.sh "$BUILD_DIR" {} + diff --git a/tests/ui-toml/update-references.sh b/tests/ui-toml/update-references.sh index 2c4fef43d96a..50d42678734e 100755 --- a/tests/ui-toml/update-references.sh +++ b/tests/ui-toml/update-references.sh @@ -16,7 +16,7 @@ if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs" fi -MYDIR=$(dirname $0) +MYDIR=$(dirname "$0") BUILD_DIR="$1" shift @@ -25,16 +25,14 @@ while [[ "$1" != "" ]]; do STDERR_NAME="${1/%.rs/.stderr}" STDOUT_NAME="${1/%.rs/.stdout}" shift - if [ -f $BUILD_DIR/$STDOUT_NAME ] && \ - ! (diff $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME >& /dev/null); then - echo updating $MYDIR/$STDOUT_NAME - cp $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME + if [[ -f "$BUILD_DIR"/"$STDOUT_NAME" ]] && \ + ! (cmp -s -- "$BUILD_DIR"/"$STDOUT_NAME" "$MYDIR"/"$STDOUT_NAME"); then + echo updating "$MYDIR"/"$STDOUT_NAME" + cp "$BUILD_DIR"/"$STDOUT_NAME" "$MYDIR"/"$STDOUT_NAME" fi - if [ -f $BUILD_DIR/$STDERR_NAME ] && \ - ! (diff $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME >& /dev/null); then - echo updating $MYDIR/$STDERR_NAME - cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME + if [[ -f "$BUILD_DIR"/"$STDERR_NAME" ]] && \ + ! (cmp -s -- "$BUILD_DIR"/"$STDERR_NAME" "$MYDIR"/"$STDERR_NAME"); then + echo updating "$MYDIR"/"$STDERR_NAME" + cp "$BUILD_DIR"/"$STDERR_NAME" "$MYDIR"/"$STDERR_NAME" fi done - - diff --git a/tests/ui/update-all-references.sh b/tests/ui/update-all-references.sh index f438d442ca1a..9f970ea26b71 100755 --- a/tests/ui/update-all-references.sh +++ b/tests/ui/update-all-references.sh @@ -13,6 +13,6 @@ if [[ "$1" == "--help" || "$1" == "-h" ]]; then fi BUILD_DIR=$PWD/target/debug/test_build_base -MY_DIR=$(dirname $0) -cd $MY_DIR -find . -name '*.rs' | xargs ./update-references.sh $BUILD_DIR +MY_DIR=$(dirname "$0") +cd "$MY_DIR" || exit +find . -name '*.rs' -exec ./update-references.sh "$BUILD_DIR" {} + diff --git a/tests/ui/update-references.sh b/tests/ui/update-references.sh index cd8b3fb33c75..2c13c327d798 100755 --- a/tests/ui/update-references.sh +++ b/tests/ui/update-references.sh @@ -16,7 +16,7 @@ if [[ "$1" == "--help" || "$1" == "-h" || "$1" == "" || "$2" == "" ]]; then echo " $0 ../../../build/x86_64-apple-darwin/test/ui *.rs */*.rs" fi -MYDIR=$(dirname $0) +MYDIR=$(dirname "$0") BUILD_DIR="$1" shift @@ -26,21 +26,19 @@ while [[ "$1" != "" ]]; do STDOUT_NAME="${1/%.rs/.stdout}" FIXED_NAME="${1/%.rs/.fixed}" shift - if [ -f $BUILD_DIR/$STDOUT_NAME ] && \ - ! (diff $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME >& /dev/null); then - echo updating $MYDIR/$STDOUT_NAME - cp $BUILD_DIR/$STDOUT_NAME $MYDIR/$STDOUT_NAME + if [[ -f "$BUILD_DIR"/"$STDOUT_NAME" ]] && \ + ! (cmp -s -- "$BUILD_DIR"/"$STDOUT_NAME" "$MYDIR"/"$STDOUT_NAME"); then + echo updating "$MYDIR"/"$STDOUT_NAME" + cp "$BUILD_DIR"/"$STDOUT_NAME" "$MYDIR"/"$STDOUT_NAME" fi - if [ -f $BUILD_DIR/$STDERR_NAME ] && \ - ! (diff $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME >& /dev/null); then - echo updating $MYDIR/$STDERR_NAME - cp $BUILD_DIR/$STDERR_NAME $MYDIR/$STDERR_NAME + if [[ -f "$BUILD_DIR"/"$STDERR_NAME" ]] && \ + ! (cmp -s -- "$BUILD_DIR"/"$STDERR_NAME" "$MYDIR"/"$STDERR_NAME"); then + echo updating "$MYDIR"/"$STDERR_NAME" + cp "$BUILD_DIR"/"$STDERR_NAME" "$MYDIR"/"$STDERR_NAME" fi - if [ -f $BUILD_DIR/$FIXED_NAME ] && \ - ! (diff $BUILD_DIR/$FIXED_NAME $MYDIR/$FIXED_NAME >& /dev/null); then - echo updating $MYDIR/$FIXED_NAME - cp $BUILD_DIR/$FIXED_NAME $MYDIR/$FIXED_NAME + if [[ -f "$BUILD_DIR"/"$FIXED_NAME" ]] && \ + ! (cmp -s -- "$BUILD_DIR"/"$FIXED_NAME" "$MYDIR"/"$FIXED_NAME"); then + echo updating "$MYDIR"/"$FIXED_NAME" + cp "$BUILD_DIR"/"$FIXED_NAME" "$MYDIR"/"$FIXED_NAME" fi done - - diff --git a/util/fetch_prs_between.sh b/util/fetch_prs_between.sh index bea5a021aefd..881aba196e72 100755 --- a/util/fetch_prs_between.sh +++ b/util/fetch_prs_between.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Fetches the merge commits between two git commits and prints the PR URL # together with the full commit message @@ -12,14 +12,15 @@ last=$2 IFS=' ' for pr in $(git log --oneline --grep "Merge #" --grep "Merge pull request" --grep "Auto merge of" --grep "Rollup merge of" "$first...$last" | sort -rn | uniq); do - id=$(echo $pr | rg -o '#[0-9]{3,5}' | cut -c 2-) - commit=$(echo $pr | cut -d' ' -f 1) - message=$(git --no-pager show --pretty=medium $commit) - if [ ! -z $(echo "$message" | rg "^[\s]{4}changelog: [nN]one\.*$") ]; then + id=$(echo "$pr" | rg -o '#[0-9]{3,5}' | cut -c 2-) + commit=$(echo "$pr" | cut -d' ' -f 1) + message=$(git --no-pager show --pretty=medium "$commit") + if [[ -n $(echo "$message" | rg "^[\s]{4}changelog: [nN]one\.*$") ]]; then continue fi echo "URL: https://github.com/rust-lang/rust-clippy/pull/$id" echo "$message" - echo "---------------------------------------------------------\n" + echo "---------------------------------------------------------" + echo done From abafec5640082f8a9792d2b591631a52004c0643 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 17 Oct 2019 17:02:24 +0700 Subject: [PATCH 2/7] macos: symlink rustc dev libs to /usr/local/lib Due to System Integrity Protection (SIP), exporting LD_LIBRARY_PATH will not work on macOS systems. Therefore, rather than disable SIP, we could symlink those rust dev libs to /usr/local/bin. I already tried install_name_tool(1) but couldn't make clippy-driver work on CI for whatever reasons. --- .travis.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index f707e622ad87..cddeafdbf7de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -110,11 +110,16 @@ before_script: rm rust-toolchain ./setup-toolchain.sh - | - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then - export PATH=$PATH:$(rustc --print sysroot)/bin - else - export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib - fi + SYSROOT=$(rustc --print sysroot) + case "$TRAVIS_OS_NAME" in + windows ) export PATH="${SYSROOT}/bin:${PATH}" ;; + linux ) export LD_LIBRARY_PATH="${SYSROOT}/lib" ;; + osx ) + # See + sudo mkdir -p /usr/local/lib + sudo find "$SYSROOT/lib" -maxdepth 1 -name '*.dylib' -exec ln -s {} /usr/local/lib \; + ;; + esac script: - | From f3ace5e71d9e1c9b41c6fe4da6b39af241829f59 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Fri, 18 Oct 2019 11:10:15 +0700 Subject: [PATCH 3/7] build: use shared target dir --- ci/base-tests.sh | 8 +++++--- ci/integration-tests.sh | 3 +++ util/dev | 4 +++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ci/base-tests.sh b/ci/base-tests.sh index 3fe0f1745356..df53b6b50440 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -1,6 +1,10 @@ #!/usr/bin/env bash set -ex +# for faster build, share target dir between subcrates +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR + echo "Running clippy base tests" PATH=$PATH:./node_modules/.bin @@ -10,9 +14,7 @@ fi # build clippy in debug mode and run tests cargo build --features "debugging deny-warnings" cargo test --features "debugging deny-warnings" -# for faster build, share target dir between subcrates -CARGO_TARGET_DIR=$(pwd)/target/ -export CARGO_TARGET_DIR + (cd clippy_lints && cargo test) (cd rustc_tools_util && cargo test) (cd clippy_dev && cargo test) diff --git a/ci/integration-tests.sh b/ci/integration-tests.sh index 6ba9a284c504..651710b83ec3 100755 --- a/ci/integration-tests.sh +++ b/ci/integration-tests.sh @@ -5,6 +5,9 @@ if [[ -z "$INTEGRATION" ]]; then exit 0 fi +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR + rm ~/.cargo/bin/cargo-clippy cargo install --force --debug --path . diff --git a/util/dev b/util/dev index 4fa6e69b7527..8e3ed97f98d5 100755 --- a/util/dev +++ b/util/dev @@ -1,3 +1,5 @@ #!/bin/sh +CARGO_TARGET_DIR=$(pwd)/target/ +export CARGO_TARGET_DIR -cd clippy_dev && cargo run -- $@ +cd clippy_dev && cargo run -- "$@" From 049800d304a8352c9823030e31f614d8a4154d11 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 22 Oct 2019 10:19:12 +0700 Subject: [PATCH 4/7] nit: ! is not on a condition and skips errexit --- ci/base-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/base-tests.sh b/ci/base-tests.sh index df53b6b50440..4a64b19d80ab 100755 --- a/ci/base-tests.sh +++ b/ci/base-tests.sh @@ -51,7 +51,7 @@ cargo test --features "debugging deny-warnings" # Run a lint and make sure it produces the expected output. It's also expected to exit with code 1 # FIXME: How to match the clippy invocation in compile-test.rs? - ! ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr + ./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/cstring.rs 2> cstring.stderr && exit 1 sed -e 's,tests/ui,$DIR,' -e '/= help/d' cstring.stderr > normalized.stderr diff normalized.stderr tests/ui/cstring.stderr From ba673d020b1af1b0ba545c29273a0723a54ae79a Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 22 Oct 2019 10:44:54 +0700 Subject: [PATCH 5/7] build: remove travis_wait Now the travis CI build time is fast enough to not cause build timeout. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cddeafdbf7de..a6af0880864d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,7 +126,7 @@ script: if [[ -n ${INTEGRATION} ]]; then ./ci/integration-tests.sh && sleep 5 else - travis_wait 30 ./ci/base-tests.sh && sleep 5 + ./ci/base-tests.sh && sleep 5 fi after_success: From 629b4d5a825f23b953e16b974e5daba069db1d85 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 22 Oct 2019 12:17:11 +0700 Subject: [PATCH 6/7] Early exit if errors in integration tests --- ci/integration-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/integration-tests.sh b/ci/integration-tests.sh index 651710b83ec3..1095ec65dac9 100755 --- a/ci/integration-tests.sh +++ b/ci/integration-tests.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -x +set -ex if [[ -z "$INTEGRATION" ]]; then exit 0 From 088d528be9b6999623cb3280e8f84ec09b5ccfb6 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Tue, 22 Oct 2019 16:11:42 +0700 Subject: [PATCH 7/7] build: remove needless BASE_TESTS env --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6af0880864d..64036ec3aa3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,11 +47,9 @@ matrix: include: # Builds that are executed for every PR - os: osx # run base tests on both platforms - env: BASE_TESTS=true - os: linux - env: BASE_TESTS=true - os: windows - env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true + env: CARGO_INCREMENTAL=0 OS_WINDOWS=true # Builds that are only executed when a PR is r+ed or a try build is started # We don't want to run these always because they go towards @@ -89,7 +87,7 @@ matrix: if: repo =~ /^rust-lang\/rust-clippy$/ AND branch IN (auto, try) allow_failures: - os: windows - env: CARGO_INCREMENTAL=0 BASE_TESTS=true OS_WINDOWS=true + env: CARGO_INCREMENTAL=0 OS_WINDOWS=true before_script: - |