Skip to content

Commit

Permalink
Notify failure if Playwright tests fail in CI (Fixes #14785)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgibson committed Jul 3, 2024
1 parent 9c7cc4d commit 755266a
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,18 +126,40 @@ jobs:
run: cd tests/playwright && npx playwright test

notify-of-test-run-completion:
if: always()
runs-on: ubuntu-latest
needs: [notify-of-test-run-start, integration-tests, playwright-tests]
steps:
- uses: actions/checkout@v4
- name: Notify via Slack of test-run outcome
- name: Notify via Slack of test-run success
if: ${{ needs.integration-tests.result == "success" && needs.playwright-tests.result == "success" }}
uses: ./.github/actions/slack
with:
env_name: test
label: "Integration tests [${{ inputs.git_sha }}]"
status: ${{ needs.integration-tests.result }}
status: "success"
channel_id: ${{ env.SLACK_CHANNEL_ID }}
slack_bot_token: ${{ env.SLACK_BOT_TOKEN }}
ref: ${{ inputs.branch }}
message: "Integration tests completed. Status: ${{ needs.integration-tests.result }}"
message: "Integration tests completed. Status: success"
- name: Notify via Slack of test-run failure
if: ${{ needs.integration-tests.result == "failure" || needs.playwright-tests.result == "failure" }}
uses: ./.github/actions/slack
with:
env_name: test
label: "Integration tests [${{ inputs.git_sha }}]"
status: "failure"
channel_id: ${{ env.SLACK_CHANNEL_ID }}
slack_bot_token: ${{ env.SLACK_BOT_TOKEN }}
ref: ${{ inputs.branch }}
message: "Integration tests completed. Status: failure"
- name: Notify via Slack of test-run cancelled
if: ${{ needs.integration-tests.result == "cancelled" || needs.playwright-tests.result == "cancelled" }}
uses: ./.github/actions/slack
with:
env_name: test
label: "Integration tests [${{ inputs.git_sha }}]"
status: "cancelled"
channel_id: ${{ env.SLACK_CHANNEL_ID }}
slack_bot_token: ${{ env.SLACK_BOT_TOKEN }}
ref: ${{ inputs.branch }}
message: "Integration tests completed. Status: cancelled"

0 comments on commit 755266a

Please sign in to comment.