diff --git a/scripts/ci/testing/run_breeze_command_with_retries.sh b/scripts/ci/testing/run_breeze_command_with_retries.sh index 0d4086b09628..7f2bb56785c4 100755 --- a/scripts/ci/testing/run_breeze_command_with_retries.sh +++ b/scripts/ci/testing/run_breeze_command_with_retries.sh @@ -28,6 +28,7 @@ for i in $(seq 1 "$NUMBER_OF_ATTEMPT") ; do breeze down set +e if breeze "$@"; then + set -e exit 0 else echo diff --git a/scripts/ci/testing/run_unit_tests.sh b/scripts/ci/testing/run_unit_tests.sh index 016f82bb757d..516647713022 100755 --- a/scripts/ci/testing/run_unit_tests.sh +++ b/scripts/ci/testing/run_unit_tests.sh @@ -31,68 +31,98 @@ TEST_SCOPE=${2} function core_tests() { echo "${COLOR_BLUE}Running core tests${COLOR_RESET}" + set +e if [[ "${TEST_SCOPE}" == "DB" ]]; then set -x breeze testing core-tests --run-in-parallel --run-db-tests-only + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "Non-DB" ]]; then set -x breeze testing core-tests --use-xdist --skip-db-tests --no-db-cleanup --backend none + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "All" ]]; then set -x breeze testing core-tests --run-in-parallel + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "Quarantined" ]]; then set -x breeze testing core-tests --test-type "All-Quarantined" + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "ARM collection" ]]; then set -x breeze testing core-tests --collect-only --remove-arm-packages --test-type "All" + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "System" ]]; then set -x breeze testing system-tests tests/system/example_empty.py + RESULT=$? set +x else echo "Unknown test scope: ${TEST_SCOPE}" + set -e exit 1 fi - echo "${COLOR_BLUE}Core tests completed${COLOR_RESET}" + set -e + if [[ ${RESULT} != "0" ]]; then + echo + echo "${COLOR_RED}The ${TEST_GROUP} test ${TEST_SCOPE} failed! Giving up${COLOR_RESET}" + echo + exit "${RESULT}" + fi + echo "${COLOR_GREEN}Core tests completed successfully${COLOR_RESET}" } function providers_tests() { echo "${COLOR_BLUE}Running providers tests${COLOR_RESET}" + set +e if [[ "${TEST_SCOPE}" == "DB" ]]; then set -x breeze testing providers-tests --run-in-parallel --run-db-tests-only + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "Non-DB" ]]; then set -x breeze testing providers-tests --use-xdist --skip-db-tests --no-db-cleanup --backend none + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "All" ]]; then set -x breeze testing providers-tests --run-in-parallel + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "Quarantined" ]]; then set -x breeze testing providers-tests --test-type "All-Quarantined" + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "ARM collection" ]]; then set -x breeze testing providers-tests --collect-only --remove-arm-packages --test-type "All" + RESULT=$? set +x elif [[ "${TEST_SCOPE}" == "System" ]]; then set -x breeze testing system-tests providers/tests/system/example_empty.py + RESULT=$? set +x else echo "Unknown test scope: ${TEST_SCOPE}" + set -e exit 1 fi - echo "${COLOR_BLUE}Providers tests completed${COLOR_RESET}" + set -e + if [[ ${RESULT} != "0" ]]; then + echo + echo "${COLOR_RED}The ${TEST_GROUP} test ${TEST_SCOPE} failed! Giving up${COLOR_RESET}" + echo + exit "${RESULT}" + fi + echo "${COLOR_GREEB}Providers tests completed successfully${COLOR_RESET}" }