-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starting adding Teams notifications to scheduled tests
- Loading branch information
Showing
2 changed files
with
104 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: No Slack - Scheduled UW IdP Test Matrix | ||
name: Scheduled UW IdP Test Matrix | ||
|
||
on: | ||
push: | ||
|
@@ -76,7 +76,50 @@ jobs: | |
- uses: UWIT-IAM/actions/[email protected] | ||
with: | ||
gcloud-token: ${{ secrets.TEST_RUNNER_GOOGLE_TOKEN }} | ||
# {"title": "IdP Web Tests running on ", "value": "'${{ env.IDP_ENV }}'"}, | ||
# {"title": "Reason for Test Run", "value": "${{ env.INPUT_REASON }}"}, | ||
# {"title": "Initiated By:", "value": "'"${{ github.actor }}"'"} | ||
# "'Glen Hardcoded Reason'" | ||
|
||
- name: Notify Teams of Test Run Start | ||
env: | ||
IDP_ENV: ${{ steps.configure.outputs.idp-env }} | ||
INPUT_REASON: ${{ steps.configure.outputs.input-reason }} | ||
run: | | ||
curl -H "Content-Type: application/json" \ | ||
-d '{ | ||
"type": "message", | ||
"attachments": [ | ||
{ | ||
"contentType": "application/vnd.microsoft.card.adaptive", | ||
"content": { | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | ||
"type": "AdaptiveCard", | ||
"version": "1.4", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"size": "Large", | ||
"weight": "Bolder", | ||
"text": "IDP Test Run Notification" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "Starting - IDP Tests ⏳", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "FactSet", | ||
"facts": [ | ||
{"title": "Reason for Test Run", "value": "'Glen Hardcoded Reason'"} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}' \ | ||
"${{ env.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" | ||
- name: Run tests | ||
run: ./scripts/run-tests.sh -- --env ${{ matrix.idp_env }} | ||
|
@@ -105,9 +148,66 @@ jobs: | |
|
||
- if: > | ||
always() | ||
&& steps.post-run.outputs.upload_storyboards =='true' | ||
&& steps.post-run.outputs.upload_storyboards == 'true' | ||
&& steps.upload-storyboards.outcome == 'success' | ||
name: Set notices on workflow | ||
env: | ||
storyboard_link: ${{ steps.config.outputs.storyboard_link }} | ||
run: echo "::notice::Storyboards located at ${{ env.storyboard_link }}" | ||
- name: Notify Teams of Test Run Completion | ||
env: | ||
TEST_STATUS: ${{ steps.run-tests.outputs.test-status }} | ||
REPORT_URL: ${{ steps.configure.outputs.report-url }} | ||
INPUT_REASON: ${{ steps.configure.outputs.input-reason }} | ||
IDP_ENV: ${{ steps.configure.outputs.idp-env }} | ||
if: always() | ||
run: | | ||
# {"title": "IdP Web Tests ran on ", "value": "'${{ env.IDP_ENV }}'"}, | ||
# {"title": "Reason for Test Run was ", "value": "${{ env.INPUT_REASON }}"}, | ||
# {"title": "Storyboards:", "value": "['"$REPORT_URL"']('"$REPORT_URL"')"}, | ||
# {"title": "Initiated By:", "value": "'"${{ github.actor }}"'"} | ||
# Set the message body dynamically based on TEST_STATUS | ||
echo "TEST_STATUS=${{ env.TEST_STATUS }}" | ||
if [ "$TEST_STATUS" = "succeeded" ]; then | ||
test_result="Test run for IDP passed successfully ✅" | ||
else | ||
test_result="Test run for IDP failed ❌" | ||
fi | ||
# Notify Teams with the status of the test run | ||
curl -H "Content-Type: application/json" \ | ||
-d '{ | ||
"type": "message", | ||
"attachments": [ | ||
{ | ||
"contentType": "application/vnd.microsoft.card.adaptive", | ||
"content": { | ||
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json", | ||
"type": "AdaptiveCard", | ||
"version": "1.4", | ||
"body": [ | ||
{ | ||
"type": "TextBlock", | ||
"size": "Large", | ||
"weight": "Bolder", | ||
"text": "Completed - IDP Test Run Notification" | ||
}, | ||
{ | ||
"type": "TextBlock", | ||
"text": "'"$test_result"'", | ||
"wrap": true | ||
}, | ||
{ | ||
"type": "FactSet", | ||
"facts": [ | ||
{"title": "Reason for Test Run", "value": "'Glen Hardcoded Reason'"} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
] | ||
}' \ | ||
"${{ secrets.TEAMS_INTEGRATIONS_DAILY_WEB_TESTS }}" | ||
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