From 8892e2e4268a6e9199af4354792ee4ca5aeff52c Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 6 Mar 2021 16:20:53 +0100 Subject: [PATCH] pytest script return status is not a reliable indicator for success/failure --- bin/run_ci_tests.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/run_ci_tests.sh b/bin/run_ci_tests.sh index 8630f63..a801482 100755 --- a/bin/run_ci_tests.sh +++ b/bin/run_ci_tests.sh @@ -29,7 +29,12 @@ run_tests() { echo "Running tests" cd "$REPO_DIR" pytest 2>&1 | tee "$TEST_LOG" - return $? + grep -e '^FAILED ' "$TEST_LOG" + if [[ $? == 0 ]]; then + return 2 # FAILURE + fi + + return 0 # PASSED } ########