-
Notifications
You must be signed in to change notification settings - Fork 632
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #915 from ArangoGutierrez/slack_bot
[no-relnote] Add Slack notification for e2e test failures
- Loading branch information
Showing
2 changed files
with
42 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,19 +28,22 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == 'push' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out code | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Calculate build vars | ||
id: vars | ||
run: | | ||
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV | ||
- name: Set up Holodeck | ||
uses: NVIDIA/[email protected] | ||
with: | ||
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws_ssh_key: ${{ secrets.AWS_SSH_KEY }} | ||
holodeck_config: "tests/e2e/infra/aws.yaml" | ||
|
||
- name: Run e2e tests | ||
env: | ||
KUBECONFIG: ${{ github.workspace }}/kubeconfig | ||
|
@@ -49,10 +52,25 @@ jobs: | |
LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs | ||
run: | | ||
make test-e2e | ||
- name: Archive test logs | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: e2e-test-logs | ||
path: ./e2e_logs/ | ||
retention-days: 15 | ||
|
||
- name: Send Slack alert notification | ||
id: slack | ||
if: ${{ failure() }} | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: | | ||
:red_target: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed. | ||
Details: ${{ env.SUMMARY_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,29 +28,34 @@ jobs: | |
runs-on: pdx01-arc-runners | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} && ${{ github.event.workflow_run.event == 'push' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
name: Check out code | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Calculate build vars | ||
id: vars | ||
run: | | ||
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV | ||
GOLANG_VERSION=$(./hack/golang-version.sh) | ||
echo "GOLANG_VERSION=${GOLANG_VERSION##GOLANG_VERSION := }" >> $GITHUB_ENV | ||
- name: Set up Holodeck | ||
uses: NVIDIA/[email protected] | ||
with: | ||
vsphere_username: ${{ secrets.VSPHERE_USERNAME }} | ||
vsphere_password: ${{ secrets.VSPHERE_PASSWORD }} | ||
vsphere_ssh_key: ${{ secrets.VSPHERE_SSH_KEY }} | ||
holodeck_config: "tests/e2e/infra/vsphere.yaml" | ||
|
||
- name: Intall dependencies | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
|
||
- name: Run e2e tests | ||
env: | ||
KUBECONFIG: ${{ github.workspace }}/kubeconfig | ||
|
@@ -59,10 +64,25 @@ jobs: | |
LOG_ARTIFACTS: ${{ github.workspace }}/e2e_logs | ||
run: | | ||
make test-e2e | ||
- name: Archive test logs | ||
if: ${{ failure() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: e2e-test-logs | ||
path: ./e2e_logs/ | ||
retention-days: 15 | ||
|
||
- name: Send Slack alert notification | ||
id: slack | ||
if: ${{ failure() }} | ||
uses: slackapi/[email protected] | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
SUMMARY_URL: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
with: | ||
channel-id: ${{ secrets.SLACK_CHANNEL_ID }} | ||
slack-message: | | ||
:red_target: On repository ${{ github.repository }} the Workflow *${{ github.workflow }}* has failed. | ||
Details: ${{ env.SUMMARY_URL }} |