From 6934383a71bea7292f72bf9eb4e7a8c859bf3db0 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 24 Feb 2021 21:45:18 +0100 Subject: [PATCH] Better logic for test_passed/test_failed return value --- bin/run_ci_tests.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/run_ci_tests.sh b/bin/run_ci_tests.sh index 01d291b..faf04d6 100755 --- a/bin/run_ci_tests.sh +++ b/bin/run_ci_tests.sh @@ -32,13 +32,14 @@ run_tests() { } check_test_results() { - grep -e '^FAILED' "$TEST_LOG" >/dev/null - ret=$? - if [[ $ret == 0 ]]; then + failed_tests=$(grep -e '^FAILED' "$TEST_LOG" >/dev/null) + ret=0 + + if [[ ! -z "$failed_tests" ]]; then echo "------------------" echo "Some tests failed!" echo "------------------" - cat "$LOGFILE" + ret=2 else echo "All tests passed" fi @@ -56,8 +57,8 @@ install_repo run_tests check_test_results -tests_passed=$? +ret=$? cleanup -exit $tests_passed +exit $ret