From 0c1d7c177ea2e776870d90527f1c07d483fb9b73 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Thu, 19 Nov 2015 08:55:21 -0800 Subject: [PATCH] tail -f all the log files --- parallel_test.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/parallel_test.sh b/parallel_test.sh index 900c99f..9e0a691 100755 --- a/parallel_test.sh +++ b/parallel_test.sh @@ -6,6 +6,8 @@ export DEBUG=superagent-sync,e2e:* export DEBUG_COLORS=true readonly tests=(app-flow-test cloudron-user-test new-user-test) +test_pids=() +test_logs=() # cleanup rm -f logs/* @@ -16,17 +18,24 @@ echo "Cleaning up" for t in "${tests[@]}"; do echo "Starting test ${t}" ./node_modules/.bin/mocha "test/${t}.js" > "logs/${t}.log" 2>&1 & + test_pids+=("$!") + test_logs+=("logs/${t}.log") 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 & +test_pids+=("$!") +test_logs+=("logs/cloudron-update-test.log") + +# stream all the logs +tail -f "${test_logs[*]}" & # wait for tests to finish fail=0 echo "Waiting for jobs to finish" -for job in `jobs -p`; do - wait $job || let "fail+=1" +for pid in "${test_pids[@]}"; do + wait $pid || let "fail+=1" done echo