From 9e05a07a7702c0108579cd330cc3f7d33ce18f94 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Tue, 30 Aug 2022 11:24:32 +0200 Subject: [PATCH] ci-automation: Return 1 on broken cycle We have set success to true when the test cycle was broken, which was a hacky way to avoid printing the give up message. But this setting success to true also meant that the script returned with status 0, which is wrong. Add another variable for controlling printing the give up message. --- ci-automation/test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci-automation/test.sh b/ci-automation/test.sh index 0dd0fce80c..c49993f869 100644 --- a/ci-automation/test.sh +++ b/ci-automation/test.sh @@ -154,6 +154,7 @@ function _test_run_impl() { local tap_merged_detailed="results-${image}-detailed.tap" local retry="" local success=false + local print_give_up=true # A job on each worker prunes old mantle images (docker image prune) echo "docker rm -f '${container_name}'" >> ./ci-cleanup.sh @@ -193,6 +194,7 @@ function _test_run_impl() { if [ -z "$failed_tests" ] ; then echo "########### All tests succeeded. ###########" success=true + print_give_up=false break fi @@ -200,9 +202,7 @@ function _test_run_impl() { echo "########### Test cycle requested to break ###########" echo "Failed tests: $failed_tests" echo "-----------" - # not really a success, but don't print a message about - # exhaused reruns and giving up - success=true + print_give_up=false break fi @@ -213,7 +213,7 @@ function _test_run_impl() { done - if ! $success; then + if ${print_give_up}; then echo "########### All re-runs exhausted ($retries). Giving up. ###########" fi