From e64a977d872e16a4739840be2010ba0d369f11a6 Mon Sep 17 00:00:00 2001 From: Hemang Date: Tue, 6 May 2025 17:39:41 +0530 Subject: [PATCH] Properly propagate the integrations test and unit test exit code. --- run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run.sh b/run.sh index 0b95bd8..636d634 100755 --- a/run.sh +++ b/run.sh @@ -70,6 +70,10 @@ down() { unit_tests() { echo "Running unit tests..." PYTHONPATH=. pytest tests/unit_tests $@ + + TEST_EXIT_CODE=$? + echo "Unit tests finished with exit code: $TEST_EXIT_CODE" + return $TEST_EXIT_CODE } integration_tests() { @@ -157,9 +161,13 @@ integration_tests() { -e INVARIANT_API_KEY="$INVARIANT_API_KEY" \ --env-file ./tests/integration/.env.test \ invariant-gateway-tests $@ + TEST_EXIT_CODE=$? + echo "Integration tests finished with exit code: $TEST_EXIT_CODE" unset GATEWAY_ROOT_PATH unset GUARDRAILS_FILE_PATH + + return $TEST_EXIT_CODE } # ----------------------------- @@ -182,10 +190,12 @@ case "$1" in "unit-tests") shift unit_tests $@ + exit $? ;; "integration-tests") shift integration_tests $@ + exit $? ;; *) echo "Usage: $0 [up|build|down|logs|unit-tests|integration-tests]"