Refactor travis.sh in order to correctly use the exit code of background test process

This commit is contained in:
evilaliv3 2016-01-09 17:58:54 +01:00
parent 6dd054efe7
commit 808ae07a18

View File

@ -34,19 +34,24 @@ elif [[ $OPENPGPJSTEST =~ ^end2end-.* ]]; then
echo "Testing Configuration: ${testkey}" echo "Testing Configuration: ${testkey}"
eval $capability eval $capability
grunt saucelabs & grunt saucelabs &
background_process_pid=$!
# https://github.com/travis-ci/travis-ci/issues/4190 # https://github.com/travis-ci/travis-ci/issues/4190
minutes=0 minutes=0
limit=30 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! echo -n -e " \b" # never leave evidences!
if [ $minutes == $limit ]; then if [ $minutes == $limit ]; then
break; exit 1
fi fi
minutes=$((minutes+1)) minutes=$((minutes+1))
sleep 60 sleep 60
done done
wait $background_process_pid
exit $? # were comes the status of the background_process :)
fi fi