From c78cee1884f8ac0aabf79aee589165a61fed4e28 Mon Sep 17 00:00:00 2001 From: "girish@cloudron.io" Date: Wed, 27 Jan 2016 08:42:51 -0800 Subject: [PATCH] bail if something fails in the middle --- parallel_test.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parallel_test.sh b/parallel_test.sh index 574d7d3..b8f2f19 100755 --- a/parallel_test.sh +++ b/parallel_test.sh @@ -12,7 +12,7 @@ test_logs=() # cleanup rm -f logs/* echo "Cleaning up" -if ! ./node_modules/.bin/mocha test/000-cleanup.js > "logs/000-cleanup.log" 2>&1; then +if ! ./node_modules/.bin/mocha --bail test/000-cleanup.js > "logs/000-cleanup.log" 2>&1; then echo "Cleanup script failed" cat "logs/000-cleanup.log" exit 1 @@ -20,7 +20,7 @@ fi # run tests for t in "${tests[@]}"; do - ./node_modules/.bin/mocha "test/${t}.js" > "logs/${t}.log" 2>&1 & + ./node_modules/.bin/mocha --bail "test/${t}.js" > "logs/${t}.log" 2>&1 & test_pids+=("$!") echo "Starting test ${t} with pid ${test_pids[-1]}" test_logs+=("logs/${t}.log") @@ -28,7 +28,7 @@ done # update test modifies release file, so run it separately sleep 20 # wait for the other tests to have created the cloudron -./node_modules/.bin/mocha "test/cloudron-update-test.js" > "logs/cloudron-update-test.log" 2>&1 & +./node_modules/.bin/mocha --bail "test/cloudron-update-test.js" > "logs/cloudron-update-test.log" 2>&1 & test_pids+=("$!") echo "Starting test cloudron-update-test with pid ${test_pids[-1]}" test_logs+=("logs/cloudron-update-test.log")