diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 56e0ca3c..d446a5e7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -35,6 +35,17 @@ jobs: # retries are added due to test failures with dependencies - name: Run tests run: script/run_tests.sh +# continue-on-error: true + + # Continue on error to capture the exit status + - name: Check exit status + run: | + if [ $? -eq 0 ]; then + echo "Workflow succeeded." + else + echo "Workflow failed." + exit 1 + fi # - name: Stop local test server # run: docker-compose -p xmtp-ios -f dev/local/docker-compose.yml down \ No newline at end of file diff --git a/script/run_tests.sh b/script/run_tests.sh index a35637d2..1acdc6ca 100755 --- a/script/run_tests.sh +++ b/script/run_tests.sh @@ -12,7 +12,12 @@ do echo "Test Succeeded" break else - echo "Test Suite Failed. Retrying..." ((retries=retries+1)) + echo "Test Suite Failed. Retrying Attempt ($retries) ..." fi done + +if [ $retries -ge 5 ]; then + echo "Maximum number of retries exceeded. Exiting with status code 1." + exit 1 +fi