From 61538ff0869939874618591d5006cd4e6709c577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Lesimple?= Date: Wed, 20 Jan 2021 11:08:11 +0000 Subject: [PATCH] chore: tests: also update totalerrors while tests are running --- tests/functional/launch_tests_on_instance.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tests/functional/launch_tests_on_instance.sh b/tests/functional/launch_tests_on_instance.sh index dac3775..3bca4aa 100755 --- a/tests/functional/launch_tests_on_instance.sh +++ b/tests/functional/launch_tests_on_instance.sh @@ -140,15 +140,22 @@ nbfailedgrep=0 nbfailedcon=0 nbfailedlog=0 nbfailedgeneric=0 +totalerrors=0 isbad=0 start_time=$(date +%s) + +update_totalerrors() +{ + (( totalerrors = nbfailedret + nbfailedgrep + nbfailedcon + nbfailedlog + nbfailedgeneric )) +} + prefix() { local elapsed=$(( $(date +%s) - start_time)) local min=$(( elapsed / 60 )) local sec=$(( elapsed - min * 60 )) - local totalerrors=$(( nbfailedret + nbfailedgrep + nbfailedcon + nbfailedgeneric )) + update_totalerrors if [ "$totalerrors" = 0 ]; then printf "%b%02dm%02d [noerror]" "$TARGET" "$min" "$sec" else @@ -463,7 +470,7 @@ echo set +e set +u -(( totalerrors = nbfailedret + nbfailedgrep + nbfailedcon + nbfailedlog + nbfailedgeneric )) +update_totalerrors [ $totalerrors -ge 255 ] && totalerrors=254 rm -rf "$mytmpdir"