From 808ae07a18899c7c3e16eeed0db65b6125360150 Mon Sep 17 00:00:00 2001 From: evilaliv3 Date: Sat, 9 Jan 2016 17:58:54 +0100 Subject: [PATCH] Refactor travis.sh in order to correctly use the exit code of background test process --- travis.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/travis.sh b/travis.sh index bc13c8a6..ec91b9c1 100755 --- a/travis.sh +++ b/travis.sh @@ -34,19 +34,24 @@ elif [[ $OPENPGPJSTEST =~ ^end2end-.* ]]; then echo "Testing Configuration: ${testkey}" eval $capability grunt saucelabs & + background_process_pid=$! # https://github.com/travis-ci/travis-ci/issues/4190 minutes=0 limit=30 - while kill -0 $! >/dev/null 2>&1; do + while kill -0 $background_process_pid >/dev/null 2>&1; do echo -n -e " \b" # never leave evidences! if [ $minutes == $limit ]; then - break; + exit 1 fi minutes=$((minutes+1)) sleep 60 done + + wait $background_process_pid + + exit $? # were comes the status of the background_process :) fi