Skip to content

Commit e5ac542

Browse files
Merge pull request #328 from microsoft/psl-test-integrate
ci: smoke test case integration
2 parents 5ee02f1 + c778838 commit e5ac542

40 files changed

Lines changed: 1068 additions & 34 deletions

.github/workflows/job-deploy-linux.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,44 @@ jobs:
277277
echo "WEBAPP_URL=${WEBAPP_URL}" >> $GITHUB_ENV
278278
echo "WEBAPP_URL=${WEBAPP_URL}" >> $GITHUB_OUTPUT
279279
280+
- name: Remove APPLICATIONINSIGHTS_CONNECTION_STRING for WAF Deployment
281+
if: inputs.WAF_ENABLED == 'true'
282+
shell: bash
283+
env:
284+
INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }}
285+
run: |
286+
echo "🔧 WAF Deployment detected - Removing APPLICATIONINSIGHTS_CONNECTION_STRING from backend container app..."
287+
288+
# Get the backend container app name
289+
BACKEND_APP_NAME=$(az containerapp list --resource-group "$INPUT_RESOURCE_GROUP_NAME" --query "[?contains(name, 'backend')].name" -o tsv | head -1)
290+
291+
if [[ -z "$BACKEND_APP_NAME" ]]; then
292+
echo "❌ ERROR: Could not find backend container app in resource group $INPUT_RESOURCE_GROUP_NAME"
293+
exit 1
294+
fi
295+
296+
echo "Found backend container app: $BACKEND_APP_NAME"
297+
298+
# Remove the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable
299+
az containerapp update \
300+
--name "$BACKEND_APP_NAME" \
301+
--resource-group "$INPUT_RESOURCE_GROUP_NAME" \
302+
--remove-env-vars APPLICATIONINSIGHTS_CONNECTION_STRING
303+
304+
echo "✅ Successfully removed APPLICATIONINSIGHTS_CONNECTION_STRING from $BACKEND_APP_NAME"
305+
306+
# Wait for the container app to restart and become healthy
307+
echo "⏳ Waiting for backend container app to restart..."
308+
sleep 30
309+
310+
# Verify the container app is running
311+
APP_STATUS=$(az containerapp show --name "$BACKEND_APP_NAME" --resource-group "$INPUT_RESOURCE_GROUP_NAME" --query "properties.runningStatus" -o tsv)
312+
echo "Backend container app status: $APP_STATUS"
313+
314+
echo "✅ WAF workaround applied successfully"
315+
280316
- name: Assign Contributor role to Service Principal
317+
continue-on-error: true
281318
if: always()
282319
env:
283320
INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }}

.github/workflows/job-deploy-windows.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,44 @@ jobs:
285285
"WEBAPP_URL=$WEBAPP_URL" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
286286
"WEBAPP_URL=$WEBAPP_URL" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
287287
288+
- name: Remove APPLICATIONINSIGHTS_CONNECTION_STRING for WAF Deployment
289+
if: inputs.WAF_ENABLED == 'true'
290+
shell: pwsh
291+
env:
292+
INPUT_RESOURCE_GROUP_NAME: ${{ inputs.RESOURCE_GROUP_NAME }}
293+
run: |
294+
Write-Host "🔧 WAF Deployment detected - Removing APPLICATIONINSIGHTS_CONNECTION_STRING from backend container app..."
295+
296+
# Get the backend container app name
297+
$BACKEND_APP_NAME = az containerapp list --resource-group "$env:INPUT_RESOURCE_GROUP_NAME" --query "[?contains(name, 'backend')].name" -o tsv | Select-Object -First 1
298+
299+
if ([string]::IsNullOrEmpty($BACKEND_APP_NAME)) {
300+
Write-Host "❌ ERROR: Could not find backend container app in resource group $env:INPUT_RESOURCE_GROUP_NAME"
301+
exit 1
302+
}
303+
304+
Write-Host "Found backend container app: $BACKEND_APP_NAME"
305+
306+
# Remove the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable
307+
az containerapp update `
308+
--name "$BACKEND_APP_NAME" `
309+
--resource-group "$env:INPUT_RESOURCE_GROUP_NAME" `
310+
--remove-env-vars APPLICATIONINSIGHTS_CONNECTION_STRING
311+
312+
Write-Host "✅ Successfully removed APPLICATIONINSIGHTS_CONNECTION_STRING from $BACKEND_APP_NAME"
313+
314+
# Wait for the container app to restart and become healthy
315+
Write-Host "⏳ Waiting for backend container app to restart..."
316+
Start-Sleep -Seconds 30
317+
318+
# Verify the container app is running
319+
$APP_STATUS = az containerapp show --name "$BACKEND_APP_NAME" --resource-group "$env:INPUT_RESOURCE_GROUP_NAME" --query "properties.runningStatus" -o tsv
320+
Write-Host "Backend container app status: $APP_STATUS"
321+
322+
Write-Host "✅ WAF workaround applied successfully"
323+
288324
- name: Assign Contributor role to Service Principal
325+
continue-on-error: true
289326
if: always()
290327
shell: bash
291328
env:

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ jobs:
9494
id: test1
9595
run: |
9696
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
97+
xvfb-run pytest -m gp --html=report/report.html --self-contained-html
98+
else
9799
xvfb-run pytest --html=report/report.html --self-contained-html
98100
fi
99101
working-directory: tests/e2e-test
@@ -109,6 +111,8 @@ jobs:
109111
if: ${{ steps.test1.outcome == 'failure' }}
110112
run: |
111113
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
114+
xvfb-run pytest -m gp --html=report/report.html --self-contained-html
115+
else
112116
xvfb-run pytest --html=report/report.html --self-contained-html
113117
fi
114118
working-directory: tests/e2e-test
@@ -124,6 +128,8 @@ jobs:
124128
if: ${{ steps.test2.outcome == 'failure' }}
125129
run: |
126130
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
131+
xvfb-run pytest -m gp --html=report/report.html --self-contained-html
132+
else
127133
xvfb-run pytest --html=report/report.html --self-contained-html
128134
fi
129135
working-directory: tests/e2e-test
@@ -134,7 +140,9 @@ jobs:
134140
if: ${{ !cancelled() }}
135141
with:
136142
name: test-report
137-
path: tests/e2e-test/report/*
143+
path: |
144+
tests/e2e-test/report/*
145+
tests/e2e-test/screenshots/*
138146
139147
- name: Generate E2E Test Summary
140148
if: always()
@@ -185,4 +193,4 @@ jobs:
185193
echo "### ❌ Test Results" >> $GITHUB_STEP_SUMMARY
186194
echo "- All test attempts failed" >> $GITHUB_STEP_SUMMARY
187195
echo "- Check the e2e-test/test job for detailed error information" >> $GITHUB_STEP_SUMMARY
188-
fi
196+
fi

tests/e2e-test/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,6 @@ screenshots/
167167
report.html
168168
assets/
169169
.vscode/
170+
171+
# Large SQL files (compress before committing)
172+
**/Large_File/*.sql

0 commit comments

Comments
 (0)