From 92c8d1cec92d6b7b44b11b895a94aad2212c564a 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 | 5 +++-- scripts/setup_travis.sh | 8 +++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/run_travis.sh b/scripts/run_travis.sh index 2a2ba34c42..620cfa4306 100755 --- a/scripts/run_travis.sh +++ b/scripts/run_travis.sh @@ -1,9 +1,10 @@ #!/bin/bash + 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 +12,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..8f3664e54d 100755 --- a/scripts/setup_travis.sh +++ b/scripts/setup_travis.sh @@ -1,4 +1,5 @@ #!/bin/bash + toplevel=$(git rev-parse --show-toplevel) function setup_chrome { @@ -51,11 +52,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 || exit 1 } # check that the desired browser is present as it might fail to install