Skip to content

Commit

Permalink
Add increased alerting for when acceptance tests fail
Browse files Browse the repository at this point in the history
This posts to the #mission-control channel when the acceptance tests
fail, these are infrequent so I don't expect things to spam up the
channel.
  • Loading branch information
ayellapragada committed Apr 11, 2024
1 parent b85c710 commit 2f73cb5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/acceptance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
module: network/sandbox
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

apply_cluster:
name: Apply Cluster
Expand All @@ -29,6 +30,7 @@ jobs:
module: cluster/sandbox-v1
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

apply_ingress:
name: Apply Ingress
Expand All @@ -40,6 +42,7 @@ jobs:
module: ingress/sandbox
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

apply_platform:
name: Apply Platform
Expand All @@ -51,6 +54,7 @@ jobs:
module: platform/sandbox-v1
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

tests:
name: Run Tests
Expand All @@ -60,6 +64,7 @@ jobs:
concurrency: ${{ github.ref_name }}-platform
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

cleanup_platform:
name: Cleanup Platform
Expand All @@ -72,6 +77,7 @@ jobs:
terraform_command: destroy
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

cleanup_ingress:
name: Cleanup Ingress
Expand All @@ -84,6 +90,7 @@ jobs:
terraform_command: destroy
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

cleanup_cluster:
name: Cleanup Cluster
Expand All @@ -96,6 +103,7 @@ jobs:
terraform_command: destroy
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

cleanup_network:
name: Cleanup Network
Expand All @@ -108,3 +116,4 @@ jobs:
terraform_command: destroy
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/terraform-dispatch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ jobs:
terraform_version: ${{ github.event.inputs.terraform_version }}
secrets:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}

SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
15 changes: 14 additions & 1 deletion .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ on:
AWS_ACCOUNT_ID:
description: AWS account in which Terraform will run
required: true
SLACK_BOT_TOKEN:
description: Token used to send messages to Slack
required: true

env:
SLACK_CHANNEL: '#mission-control'

jobs:
plan:
Expand All @@ -26,7 +32,6 @@ jobs:
working-directory: ${{ inputs.module }}

steps:

- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -92,3 +97,11 @@ jobs:
run: |
terraform ${{ inputs.terraform_command }} -auto-approve
- name: Notify Slack
if: failure()
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
with:
channel-id: ${{ env.SLACK_CHANNEL }}
slack-message: "Flightdeck acceptance terraform has failed to ${{ inputs.terraform_command }} on the ${{ inputs.module }} module."
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
13 changes: 13 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ on:
AWS_ACCOUNT_ID:
description: AWS account in which tests will run
required: true
SLACK_BOT_TOKEN:
description: Token used to send messages to Slack
required: true

env:
KUBECONFIG: /tmp/kubeconfig
SLACK_CHANNEL: '#mission-control'

jobs:
plan:
Expand Down Expand Up @@ -68,3 +72,12 @@ jobs:
make tests \
ADDRESS=https://${{ github.ref_name }}.flightdeck-test.thoughtbot.com \
CLUSTER="$CLUSTER"
- name: Notify Slack
if: failure()
uses: slackapi/slack-github-action@007b2c3c751a190b6f0f040e47ed024deaa72844 # v1.23.0
with:
channel-id: ${{ env.SLACK_CHANNEL }}
slack-message: "Flightdeck acceptance tests have failed on the testing cluster."
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

0 comments on commit 2f73cb5

Please sign in to comment.