Skip to content

Commit 40f6976

Browse files
folder renamed for Test Automation scripts
1 parent cc15915 commit 40f6976

18 files changed

Lines changed: 14 additions & 23 deletions

File tree

.github/workflows/test-automation.yml

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@ on:
66
- main
77
- dev
88
- migrate-test-automation
9-
# paths:
10-
# - 'TestAutomation/**'
9+
paths:
10+
- 'tests/e2e-test/**'
1111
schedule:
1212
- cron: '0 13 * * *' # Runs at 1 PM UTC
1313
workflow_dispatch:
1414

1515
env:
16-
# url: ${{ vars.CODEGEN_WEB_URL }}
17-
url: https://cm3ydcorjzov5mfrontend.greencliff-0258c52e.uksouth.azurecontainerapps.io
16+
url: ${{ vars.CODEGEN_WEB_URL }}
1817
accelerator_name: "Code Modernization"
1918

2019
jobs:
2120
test:
22-
permissions:
23-
id-token: write
24-
contents: read
2521

2622
runs-on: ubuntu-latest
2723
steps:
@@ -44,16 +40,13 @@ jobs:
4440
with:
4541
azcliversion: 'latest'
4642
inlineScript: |
47-
# az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEGEN_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_FRONTEND_CONTAINER_NAME }}/start?api-version=2025-01-01"
48-
# az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEGEN_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_BACKEND_CONTAINER_NAME }}/start?api-version=2025-01-01"
49-
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/codegen-automation/providers/Microsoft.App/containerApps/cm3ydcorjzov5mfrontend/start?api-version=2025-01-01"
50-
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/codegen-automation/providers/Microsoft.App/containerApps/cm3ydcorjzov5mbackend/start?api-version=2025-01-01"
51-
43+
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEGEN_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_FRONTEND_CONTAINER_NAME }}/start?api-version=2025-01-01"
44+
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CODEGEN_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_BACKEND_CONTAINER_NAME }}/start?api-version=2025-01-01"
5245
5346
- name: Install dependencies
5447
run: |
5548
python -m pip install --upgrade pip
56-
pip install -r TestAutomation/requirements.txt
49+
pip install -r tests/e2e-test/requirements.txt
5750
5851
- name: Ensure browsers are installed
5952
run: python -m playwright install --with-deps chromium
@@ -62,7 +55,7 @@ jobs:
6255
id: test1
6356
run: |
6457
xvfb-run pytest --headed --html=report/report.html --self-contained-html
65-
working-directory: TestAutomation
58+
working-directory: tests/e2e-test
6659
continue-on-error: true
6760

6861
- name: Sleep for 30 seconds
@@ -75,7 +68,7 @@ jobs:
7568
if: ${{ steps.test1.outcome == 'failure' }}
7669
run: |
7770
xvfb-run pytest --headed --html=report/report.html --self-contained-html
78-
working-directory: TestAutomation
71+
working-directory: tests/e2e-test
7972
continue-on-error: true
8073

8174
- name: Sleep for 60 seconds
@@ -88,15 +81,15 @@ jobs:
8881
if: ${{ steps.test2.outcome == 'failure' }}
8982
run: |
9083
xvfb-run pytest --headed --html=report/report.html --self-contained-html
91-
working-directory: TestAutomation
84+
working-directory: tests/e2e-test
9285

9386
- name: Upload test report
9487
id: upload_report
9588
uses: actions/upload-artifact@v4
9689
if: ${{ !cancelled() }}
9790
with:
9891
name: test-report
99-
path: TestAutomation/report/*
92+
path: tests/e2e-test/report/*
10093

10194
- name: Send Notification
10295
if: always()
@@ -108,15 +101,15 @@ jobs:
108101
if [ "$IS_SUCCESS" = "true" ]; then
109102
EMAIL_BODY=$(cat <<EOF
110103
{
111-
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.</p><p><strong>Run URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p><strong>Test Report:</strong> ${REPORT_URL}</p><p>Best regards,<br>Your Automation Team</p>",
104+
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.</p><p><strong>Run URL:</strong> <a href="${RUN_URL}">${RUN_URL}</a><br></p><p><strong>Test Report:</strong> <a href="${REPORT_URL}">${REPORT_URL}</a></p><p>Best regards,<br>Your Automation Team</p>",
112105
"subject": "${{ env.accelerator_name }} Test Automation - Success"
113106
}
114107
EOF
115108
)
116109
else
117110
EMAIL_BODY=$(cat <<EOF
118111
{
119-
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Run URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p><strong>Test Report:</strong> ${REPORT_URL}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
112+
"body": "<p>Dear Team,</p><p>We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Run URL:</strong> <a href="${RUN_URL}">${RUN_URL}</a><br></p><p><strong>Test Report:</strong> <a href="${REPORT_URL}">${REPORT_URL}</a></p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>",
120113
"subject": "${{ env.accelerator_name }} Test Automation - Failure"
121114
}
122115
EOF
@@ -134,8 +127,6 @@ jobs:
134127
with:
135128
azcliversion: 'latest'
136129
inlineScript: |
137-
# az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CodeGen_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_FRONTEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
138-
# az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CodeGen_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_BACKEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
139-
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/codegen-automation/providers/Microsoft.App/containerApps/cm3ydcorjzov5mfrontend/stop?api-version=2025-01-01"
140-
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/codegen-automation/providers/Microsoft.App/containerApps/cm3ydcorjzov5mbackend/stop?api-version=2025-01-01"
130+
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CodeGen_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_FRONTEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
131+
az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CodeGen_RG }}/providers/Microsoft.App/containerApps/${{ vars.CODEGEN_BACKEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
141132
az logout
File renamed without changes.

0 commit comments

Comments
 (0)