From 00db9c8a9b55243625f6eed318ef4ed1455af743 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Mon, 9 Sep 2024 16:28:10 +0100 Subject: [PATCH] fix(run_unit_tests)_: don't exit in nightly runs (#5808) --- _assets/scripts/run_unit_tests.sh | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/_assets/scripts/run_unit_tests.sh b/_assets/scripts/run_unit_tests.sh index f66765aee..c8b6d55b7 100755 --- a/_assets/scripts/run_unit_tests.sh +++ b/_assets/scripts/run_unit_tests.sh @@ -127,13 +127,17 @@ else wait fi -for exit_code_file in "${GIT_ROOT}"/exit_code_*.txt; do - read exit_code < "${exit_code_file}" - if [[ "${exit_code}" -ne 0 ]]; then - echo -e "${RED}Testing failed${RST}, exit code: ${exit_code}" - exit ${exit_code} - fi -done +# When running in PRs (count=1), early exit if any test failed. +# When running nightly (count>1), generate test stats ant coverage reports anyway. +if [[ $UNIT_TEST_COUNT -eq 1 ]]; then + for exit_code_file in "${GIT_ROOT}"/exit_code_*.txt; do + read exit_code < "${exit_code_file}" + if [[ "${exit_code}" -ne 0 ]]; then + echo -e "${RED}Testing failed${RST}, exit code: ${exit_code}" + exit ${exit_code} + fi + done +fi # Gather test coverage results merged_coverage_report="coverage_merged.out"