Skip to content

Commit 83e26bf

Browse files
Merge pull request #645 from microsoft/psl-smoketesting-integration
ci: Integrated Smoke Testing Automation
2 parents 162e38a + 2e9211f commit 83e26bf

File tree

12 files changed

+5797
-280
lines changed

12 files changed

+5797
-280
lines changed

.github/workflows/deploy-orchestrator.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
secrets: inherit
7575

7676
deploy:
77-
if: always() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)
77+
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
7878
needs: docker-build
7979
uses: ./.github/workflows/job-deploy.yml
8080
with:
@@ -94,7 +94,7 @@ jobs:
9494
secrets: inherit
9595

9696
e2e-test:
97-
if: always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))
97+
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
9898
needs: [docker-build, deploy]
9999
uses: ./.github/workflows/test-automation-v2.yml
100100
with:
@@ -103,7 +103,7 @@ jobs:
103103
secrets: inherit
104104

105105
send-notification:
106-
if: always()
106+
if: "!cancelled()"
107107
needs: [docker-build, deploy, e2e-test]
108108
uses: ./.github/workflows/job-send-notification.yml
109109
with:
@@ -122,7 +122,7 @@ jobs:
122122
secrets: inherit
123123

124124
cleanup-deployment:
125-
if: always() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)
125+
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
126126
needs: [docker-build, deploy, e2e-test]
127127
uses: ./.github/workflows/job-cleanup-deployment.yml
128128
with:

.github/workflows/job-deploy.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
echo "RESOURCE_GROUP_NAME=${{ inputs.resource_group_name }}" >> $GITHUB_ENV
203203
else
204204
echo "Generating a unique resource group name..."
205-
ACCL_NAME="docgenv2" # Account name as specified
205+
ACCL_NAME="docgen" # Account name as specified
206206
SHORT_UUID=$(uuidgen | cut -d'-' -f1)
207207
UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
208208
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
@@ -298,9 +298,7 @@ jobs:
298298
echo "" >> $GITHUB_STEP_SUMMARY
299299
echo "| Configuration | Value |" >> $GITHUB_STEP_SUMMARY
300300
echo "|---------------|-------|" >> $GITHUB_STEP_SUMMARY
301-
echo "| **Trigger Type** | \`${{ github.event_name }}\` |" >> $GITHUB_STEP_SUMMARY
302301
echo "| **Branch** | \`${{ env.BRANCH_NAME }}\` |" >> $GITHUB_STEP_SUMMARY
303-
echo "| **Runner OS** | \`${{ inputs.runner_os }}\` |" >> $GITHUB_STEP_SUMMARY
304302
echo "| **WAF Enabled** | ${{ env.WAF_ENABLED == 'true' && '✅ Yes' || '❌ No' }} |" >> $GITHUB_STEP_SUMMARY
305303
echo "| **EXP Enabled** | ${{ env.EXP == 'true' && '✅ Yes' || '❌ No' }} |" >> $GITHUB_STEP_SUMMARY
306304
echo "| **Run E2E Tests** | \`${{ env.RUN_E2E_TESTS }}\` |" >> $GITHUB_STEP_SUMMARY
@@ -328,7 +326,7 @@ jobs:
328326
deploy-linux:
329327
name: Deploy on Linux
330328
needs: azure-setup
331-
if: inputs.runner_os == 'ubuntu-latest' && always() && needs.azure-setup.result == 'success'
329+
if: inputs.runner_os == 'ubuntu-latest' && !cancelled() && needs.azure-setup.result == 'success'
332330
uses: ./.github/workflows/job-deploy-linux.yml
333331
with:
334332
ENV_NAME: ${{ needs.azure-setup.outputs.ENV_NAME }}
@@ -346,7 +344,7 @@ jobs:
346344
deploy-windows:
347345
name: Deploy on Windows
348346
needs: azure-setup
349-
if: inputs.runner_os == 'windows-latest' && always() && needs.azure-setup.result == 'success'
347+
if: inputs.runner_os == 'windows-latest' && !cancelled() && needs.azure-setup.result == 'success'
350348
uses: ./.github/workflows/job-deploy-windows.yml
351349
with:
352350
ENV_NAME: ${{ needs.azure-setup.outputs.ENV_NAME }}

.github/workflows/job-send-notification.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ jobs:
192192
193193
EMAIL_BODY=$(cat <<EOF
194194
{
195-
"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>",
196-
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation Passed (Existing URL)"
195+
"body": "<p>Dear Team,</p><p>The ${{ env.accelerator_name }} pipeline executed against the <strong>specified Target 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>",
196+
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation Passed"
197197
}
198198
EOF
199199
)
@@ -213,8 +213,8 @@ jobs:
213213
214214
EMAIL_BODY=$(cat <<EOF
215215
{
216-
"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>",
217-
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation Failed (Existing URL)"
216+
"body": "<p>Dear Team,</p><p>The ${{ env.accelerator_name }} pipeline executed against the <strong>specified Target 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>",
217+
"subject": "${{ env.accelerator_name }} Pipeline - Test Automation Failed"
218218
}
219219
EOF
220220
)

.github/workflows/test-automation-v2.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ jobs:
9191
id: test1
9292
run: |
9393
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
94-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
94+
xvfb-run pytest -m goldenpath --html=report/report.html --self-contained-html
95+
else
96+
xvfb-run pytest --html=report/report.html --self-contained-html
9597
fi
9698
working-directory: tests/e2e-test
9799
continue-on-error: true
@@ -106,7 +108,9 @@ jobs:
106108
if: ${{ steps.test1.outcome == 'failure' }}
107109
run: |
108110
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
109-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
111+
xvfb-run pytest -m goldenpath --html=report/report.html --self-contained-html
112+
else
113+
xvfb-run pytest --html=report/report.html --self-contained-html
110114
fi
111115
working-directory: tests/e2e-test
112116
continue-on-error: true
@@ -121,7 +125,9 @@ jobs:
121125
if: ${{ steps.test2.outcome == 'failure' }}
122126
run: |
123127
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
124-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
128+
xvfb-run pytest -m goldenpath --html=report/report.html --self-contained-html
129+
else
130+
xvfb-run pytest --html=report/report.html --self-contained-html
125131
fi
126132
working-directory: tests/e2e-test
127133

@@ -131,7 +137,9 @@ jobs:
131137
if: ${{ !cancelled() }}
132138
with:
133139
name: test-report
134-
path: tests/e2e-test/report/*
140+
path: |
141+
tests/e2e-test/report/*
142+
tests/e2e-test/screenshots/*
135143
136144
- name: Generate E2E Test Summary
137145
if: always()

tests/e2e-test/config/constants.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,25 @@
1313
# browse input data
1414
browse_question1 = "What are typical sections in a promissory note?"
1515
browse_question2 = "List the details of two promissory notes governed by the laws of the state of California"
16+
browse_question3 = "List all documents and their value"
17+
browse_question4 = "list each promissory note, the borrower name, the lender name, the amount, and the interest rate in table format where the interest rate is not 5%"
18+
browse_question5 = "list each promissory note, the borrower name, the lender name, the amount, and the interest rate in tabular format where the interest rate is not 5%"
1619

1720
# Generate input data
1821
generate_question1 = "Generate promissory note for Washington State"
1922
add_section = "Add Payment acceleration clause after the payment terms sections"
2023

24+
remove_section = "Remove Borrower Information Promissory note"
25+
2126
# Response Text Data
2227
invalid_response = "I was unable to find content related to your query and could not generate a template. Please try again."
2328
invalid_response1 = "An error occurred. Answers can't be saved at this time. If the problem persists, please contact the site administrator."
29+
30+
31+
# Construct the absolute path to the JSON file
32+
# Note: This section is commented out as prompts.json file doesn't exist
33+
# All required constants are defined above
34+
# json_file_path = os.path.join(repo_root, 'tests/e2e-test', 'testdata', 'prompts.json')
35+
# with open(json_file_path, 'r') as file:
36+
# data = json.load(file)
37+
# questions = data['questions']

0 commit comments

Comments
 (0)