Skip to content

Commit

Permalink
fail with custom exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
johnrwatson committed Dec 8, 2024
1 parent df479d9 commit 393bf7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/run-api-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,8 @@ jobs:
if: ${{ failure() }} #&& github.ref == 'refs/heads/main' }} #TODO(johnrwatson): disable comment before merging
steps:
- run: |
EXCLUDED_EXIT_CODES="3,4,5"
if echo "$EXCLUDED_EXIT_CODES" | grep -qw "$LAST_EXIT_CODE"; then
echo "Exit code $LAST_EXIT_CODE is in the excluded list, doing nothing."
else { # Page someone as it's not explicitly excluded
VALID_FAILIRE_EXIT_CODES="53"
if echo "$VALID_FAILIRE_EXIT_CODES" | grep -qw "$LAST_EXIT_CODE"; then
curl --location "${{ secrets.FIREHYDRANT_WEBHOOK_URL }}" \
--header "Content-Type: application/json" \
--data "{
Expand All @@ -153,7 +151,9 @@ jobs:
\"tags\": [
\"service:github\"
]
}"
}"
else { # Page someone as it's not explicitly excluded
echo "Exit code $LAST_EXIT_CODE is in the excluded list, doing nothing."
}
- run: |
curl -X POST \
Expand Down
2 changes: 1 addition & 1 deletion bin/si-api-test/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ if (import.meta.main) {
clearInterval(intervalId);
console.log("~~ FINAL REPORT GENERATED ~~");
await printTestReport(testReport, reportFile);
const exitCode = testsFailed(testReport) ? 1 : 0;
const exitCode = testsFailed(testReport) ? 53 : 0;
Deno.exit(exitCode);
}

Expand Down

0 comments on commit 393bf7f

Please sign in to comment.