From 7504cc71d2f046e6cbe9157441fd2effcab770da Mon Sep 17 00:00:00 2001 From: Alexei Date: Thu, 7 Jun 2018 16:12:41 -0400 Subject: [PATCH] Fail early and travis_retry when npm install fails --- scripts/run_travis.sh | 8 ++++++-- scripts/setup_travis.sh | 11 ++++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/scripts/run_travis.sh b/scripts/run_travis.sh index 2a2ba34c42..83eb401f10 100755 --- a/scripts/run_travis.sh +++ b/scripts/run_travis.sh @@ -1,9 +1,13 @@ #!/bin/bash + +# stop on errors (nonzero exit codes) +set -e + toplevel=$(git rev-parse --show-toplevel) testdir=${toplevel}/tests/selenium function run_lint { - make -C ${toplevel} lint + make -C "$toplevel" lint if [ $? != 0 ]; then echo "Linting errors" exit 1 @@ -11,7 +15,7 @@ function run_lint { } function run_selenium { - py.test --capture=no --verbose --durations=10 ${testdir} # autodiscover and run the tests + py.test --capture=no --verbose --durations=10 "$testdir" # autodiscover and run the tests } if [ "$INFO" == "lint" ]; then diff --git a/scripts/setup_travis.sh b/scripts/setup_travis.sh index d9eee60082..5df9fc197d 100755 --- a/scripts/setup_travis.sh +++ b/scripts/setup_travis.sh @@ -1,4 +1,8 @@ #!/bin/bash + +# stop on errors (nonzero exit codes) +set -e + toplevel=$(git rev-parse --show-toplevel) function setup_chrome { @@ -51,11 +55,8 @@ function browser_setup { } function setup_lint { - pushd "$toplevel" - # "--production" to skip installing devDependencies modules - npm install --production - popd - + # "--production" to skip installing devDependencies modules + npm install --production } # check that the desired browser is present as it might fail to install