Skip to content

Commit f4a3bfe

Browse files
Added TEST_SUITE_NAME to emails
1 parent 0deabfe commit f4a3bfe

1 file changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/deploy-v2.yml

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,22 @@ jobs:
633633
env:
634634
accelerator_name: "Content Processing"
635635
steps:
636+
- name: Determine Test Suite Display Name
637+
id: test_suite
638+
run: |
639+
# Determine test suite display name based on RUN_E2E_TESTS value
640+
if [ "${{ env.RUN_E2E_TESTS }}" = "GoldenPath-Testing" ]; then
641+
TEST_SUITE_NAME="Golden Path Testing"
642+
elif [ "${{ env.RUN_E2E_TESTS }}" = "Smoke-Testing" ]; then
643+
TEST_SUITE_NAME="Smoke Testing"
644+
elif [ "${{ env.RUN_E2E_TESTS }}" = "None" ]; then
645+
TEST_SUITE_NAME="None"
646+
else
647+
TEST_SUITE_NAME="${{ env.RUN_E2E_TESTS }}"
648+
fi
649+
echo "TEST_SUITE_NAME=$TEST_SUITE_NAME" >> $GITHUB_OUTPUT
650+
echo "Test Suite: $TEST_SUITE_NAME"
651+
636652
- name: Send Quota Failure Notification
637653
if: needs.deploy.result == 'failure' && needs.deploy.outputs.QUOTA_FAILED == 'true'
638654
run: |
@@ -674,6 +690,7 @@ jobs:
674690
WEBAPP_URL="${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || github.event.inputs.existing_webapp_url }}"
675691
RESOURCE_GROUP="${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}"
676692
TEST_REPORT_URL="${{ needs.e2e-test.outputs.TEST_REPORT_URL }}"
693+
TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}"
677694
678695
# Create email body based on test result
679696
if [ "${{ needs.e2e-test.result }}" = "skipped" ]; then
@@ -687,7 +704,7 @@ jobs:
687704
else
688705
EMAIL_BODY=$(cat <<EOF
689706
{
690-
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} deployment and testing process has completed successfully.</p><p><strong>Deployment Details:</strong><br>• Resource Group: ${RESOURCE_GROUP}<br>• Web App URL: <a href='${WEBAPP_URL}'>${WEBAPP_URL}</a><br>• E2E Tests: Passed<br>• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a></p><p><strong>Configuration:</strong><br>• WAF Enabled: ${{ env.WAF_ENABLED }}<br>• EXP Enabled: ${{ env.EXP }}</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
707+
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} deployment and testing process has completed successfully.</p><p><strong>Deployment Details:</strong><br>• Resource Group: ${RESOURCE_GROUP}<br>• Web App URL: <a href='${WEBAPP_URL}'>${WEBAPP_URL}</a><br>• E2E Tests: Passed ✅<br>• Test Suite: ${TEST_SUITE_NAME}<br>• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a></p><p><strong>Configuration:</strong><br>• WAF Enabled: ${{ env.WAF_ENABLED }}<br>• EXP Enabled: ${{ env.EXP }}</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
691708
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation - Success"
692709
}
693710
EOF
@@ -705,10 +722,11 @@ jobs:
705722
TEST_REPORT_URL="${{ needs.e2e-test.outputs.TEST_REPORT_URL }}"
706723
WEBAPP_URL="${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || github.event.inputs.existing_webapp_url }}"
707724
RESOURCE_GROUP="${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}"
725+
TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}"
708726
709727
EMAIL_BODY=$(cat <<EOF
710728
{
711-
"body": "<p>Dear Team,</p><p>We would like to inform you that ${{ env.accelerator_name }} accelerator test automation process has encountered issues and failed to complete successfully.</p><p><strong>Deployment Details:</strong><br>• Resource Group: ${RESOURCE_GROUP}<br>• Web App URL: <a href='${WEBAPP_URL}'>${WEBAPP_URL}</a><br>• Deployment Status: ✅ Success<br>• E2E Tests: ❌ Failed</p><p><strong>Test Details:</strong><br>• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a></p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
729+
"body": "<p>Dear Team,</p><p>We would like to inform you that ${{ env.accelerator_name }} accelerator test automation process has encountered issues and failed to complete successfully.</p><p><strong>Deployment Details:</strong><br>• Resource Group: ${RESOURCE_GROUP}<br>• Web App URL: <a href='${WEBAPP_URL}'>${WEBAPP_URL}</a><br>• Deployment Status: ✅ Success<br>• E2E Tests: ❌ Failed<br>• Test Suite: ${TEST_SUITE_NAME}</p><p><strong>Test Details:</strong><br>• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a></p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
712730
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation - Failed"
713731
}
714732
EOF
@@ -725,9 +743,11 @@ jobs:
725743
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
726744
EXISTING_URL="${{ github.event.inputs.existing_webapp_url }}"
727745
TEST_REPORT_URL="${{ needs.e2e-test.outputs.TEST_REPORT_URL }}"
746+
TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}"
747+
728748
EMAIL_BODY=$(cat <<EOF
729749
{
730-
"body": "<p>Dear Team,</p><p>The ${{ env.accelerator_name }} pipeline executed against the <strong>existing WebApp URL</strong> and testing process has completed successfully.</p><p><strong>Test Results:</strong><br>• Status: ✅ Passed<br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a></p><p><strong>Deployment:</strong> Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
750+
"body": "<p>Dear Team,</p><p>The ${{ env.accelerator_name }} pipeline executed against the <strong>existing WebApp URL</strong> and testing process has completed successfully.</p><p><strong>Test Results:</strong><br>• Status: ✅ Passed<br>• Test Suite: ${TEST_SUITE_NAME}<br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a></p><p><strong>Deployment:</strong> Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
731751
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation Passed (Existing URL)"
732752
}
733753
EOF
@@ -744,9 +764,11 @@ jobs:
744764
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
745765
EXISTING_URL="${{ github.event.inputs.existing_webapp_url }}"
746766
TEST_REPORT_URL="${{ needs.e2e-test.outputs.TEST_REPORT_URL }}"
767+
TEST_SUITE_NAME="${{ steps.test_suite.outputs.TEST_SUITE_NAME }}"
768+
747769
EMAIL_BODY=$(cat <<EOF
748770
{
749-
"body": "<p>Dear Team,</p><p>The ${{ env.accelerator_name }} pipeline executed against the <strong>existing WebApp URL</strong> and the test automation has encountered issues and failed to complete successfully.</p><p><strong>Failure Details:</strong><br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a><br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Deployment: Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
771+
"body": "<p>Dear Team,</p><p>The ${{ env.accelerator_name }} pipeline executed against the <strong>existing WebApp URL</strong> and the test automation has encountered issues and failed to complete successfully.</p><p><strong>Failure Details:</strong><br>• Target URL: <a href='${EXISTING_URL}'>${EXISTING_URL}</a><br>${TEST_REPORT_URL:+• Test Report: <a href='${TEST_REPORT_URL}'>View Report</a>}<br>• Test Suite: ${TEST_SUITE_NAME}<br>• Deployment: Skipped</p><p><strong>Run URL:</strong> <a href='${RUN_URL}'>${RUN_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
750772
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation Failed (Existing URL)"
751773
}
752774
EOF

0 commit comments

Comments
 (0)