-
Notifications
You must be signed in to change notification settings - Fork 246
ci: Added Post deployment Script into pipeline and integrated Smoke testing automation #748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
28b3fe1
fa699fb
55a817d
d9c4c16
edad86b
bab1d03
8632250
ffed96d
69d6a17
5f7dfcf
26562e8
526e8db
ced3d90
9417889
0038a3f
67812f7
87ab280
0269657
855736c
428c685
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Deploy-Test-Cleanup Linux | ||
| name: Deploy-Test-Cleanup (v2) Linux | ||
| on: | ||
| pull_request: | ||
| branches: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Deploy-Test-Cleanup Windows | ||
| name: Deploy-Test-Cleanup (v2) Windows | ||
| on: | ||
| # push: | ||
| # branches: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -283,7 +283,7 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||
| if [[ -n "$AZURE_EXISTING_AI_PROJECT_RESOURCE_ID" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| EXP_AI_PROJECT_ID="$AZURE_EXISTING_AI_PROJECT_RESOURCE_ID" | ||||||||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||||||
| EXP_AI_PROJECT_ID="${{ secrets.AZURE_ENV_FOUNDRY_PROJECT_ID }}" | ||||||||||||||||||||||||||||||||||||||||||||||
| EXP_AI_PROJECT_ID="${{ secrets.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}" | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| echo "AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: $EXP_LOG_ANALYTICS_ID" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -297,24 +297,54 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||
| azd up --no-prompt | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| echo "✅ Deployment succeeded." | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "$DEPLOY_OUTPUT" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| echo "Extracting deployment outputs..." | ||||||||||||||||||||||||||||||||||||||||||||||
| DEPLOY_OUTPUT=$(azd env get-values --output json) | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "Deployment output: $DEPLOY_OUTPUT" | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| if [[ -z "$DEPLOY_OUTPUT" ]]; then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "Error: Deployment output is empty. Please check the deployment logs." | ||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||
| API_APP_URL=$(azd env get-value API_APP_URL) | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "API_APP_URL=${API_APP_URL}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "API_APP_URL=${API_APP_URL}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| WEB_APP_URL=$(azd env get-value WEB_APP_URL) | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "WEB_APP_URL=${WEB_APP_URL}" >> $GITHUB_ENV | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "WEB_APP_URL=${WEB_APP_URL}" >> $GITHUB_OUTPUT | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| - name: Install ODBC Driver 18 for SQL Server | ||||||||||||||||||||||||||||||||||||||||||||||
| shell: bash | ||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||
| if ! [[ "18.04 20.04 22.04 24.04 24.10" == *"$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)"* ]]; | ||||||||||||||||||||||||||||||||||||||||||||||
| then | ||||||||||||||||||||||||||||||||||||||||||||||
| echo "Ubuntu $(grep VERSION_ID /etc/os-release | cut -d '"' -f 2) is not currently supported."; | ||||||||||||||||||||||||||||||||||||||||||||||
| exit 1; | ||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||
| # Download the package to configure the Microsoft repo | ||||||||||||||||||||||||||||||||||||||||||||||
| curl -fsSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb || { echo "Failed to download Microsoft packages config"; exit 1; } | ||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+313
to
+320
|
||||||||||||||||||||||||||||||||||||||||||||||
| if ! [[ "18.04 20.04 22.04 24.04 24.10" == *"$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)"* ]]; | |
| then | |
| echo "Ubuntu $(grep VERSION_ID /etc/os-release | cut -d '"' -f 2) is not currently supported."; | |
| exit 1; | |
| fi | |
| # Download the package to configure the Microsoft repo | |
| curl -fsSL -O https://packages.microsoft.com/config/ubuntu/$(grep VERSION_ID /etc/os-release | cut -d '"' -f 2)/packages-microsoft-prod.deb || { echo "Failed to download Microsoft packages config"; exit 1; } | |
| UBUNTU_VERSION=$(grep '^VERSION_ID=' /etc/os-release | cut -d '"' -f 2) | |
| case "$UBUNTU_VERSION" in | |
| 18.04|20.04|22.04|24.04|24.10) | |
| # Supported versions | |
| ;; | |
| *) | |
| echo "Ubuntu $UBUNTU_VERSION is not currently supported."; | |
| exit 1; | |
| ;; | |
| esac | |
| # Download the package to configure the Microsoft repo | |
| curl -fsSL -O https://packages.microsoft.com/config/ubuntu/${UBUNTU_VERSION}/packages-microsoft-prod.deb || { echo "Failed to download Microsoft packages config"; exit 1; } |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -98,10 +98,47 @@ jobs: | |||||||||||
| attempt=$((attempt + 1)) | ||||||||||||
| done | ||||||||||||
|
|
||||||||||||
| - name: Validate Use Case and Test Suite | ||||||||||||
| run: | | ||||||||||||
| echo "Validating use case: '${{ env.azure_env_use_case }}'" | ||||||||||||
| echo "Validating test suite: '${{ env.test_suite }}'" | ||||||||||||
|
|
||||||||||||
| # Validate use case | ||||||||||||
| if [ -z "${{ env.azure_env_use_case }}" ]; then | ||||||||||||
| echo "ERROR: AZURE_ENV_USE_CASE is empty or not provided" | ||||||||||||
| exit 1 | ||||||||||||
| elif [ "${{ env.azure_env_use_case }}" != "telecom" ] && [ "${{ env.azure_env_use_case }}" != "IT_helpdesk" ]; then | ||||||||||||
| echo "ERROR: Invalid AZURE_ENV_USE_CASE '${{ env.azure_env_use_case }}'. Must be 'telecom' or 'IT_helpdesk'" | ||||||||||||
| exit 1 | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| # Validate test suite | ||||||||||||
| if [ -z "${{ env.test_suite }}" ]; then | ||||||||||||
| echo "ERROR: TEST_SUITE is empty or not provided" | ||||||||||||
| exit 1 | ||||||||||||
| elif [ "${{ env.test_suite }}" != "GoldenPath-Testing" ] && [ "${{ env.test_suite }}" != "Smoke-Testing" ]; then | ||||||||||||
| echo "ERROR: Invalid TEST_SUITE '${{ env.test_suite }}'. Must be 'GoldenPath-Testing' or 'Smoke-Testing'" | ||||||||||||
| exit 1 | ||||||||||||
| fi | ||||||||||||
|
|
||||||||||||
| echo "✅ Use case '${{ env.azure_env_use_case }}' and test suite '${{ env.test_suite }}' are valid" | ||||||||||||
|
|
||||||||||||
| - name: Run tests(1) | ||||||||||||
| id: test1 | ||||||||||||
| run: | | ||||||||||||
| xvfb-run pytest --headed --html=report/report.html --self-contained-html | ||||||||||||
| if [ "${{ env.azure_env_use_case }}" == "telecom" ]; then | ||||||||||||
| if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then | ||||||||||||
| xvfb-run pytest tests/test_telecom_gp_tc.py --headed --html=report/report.html --self-contained-html | ||||||||||||
| elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then | ||||||||||||
| xvfb-run pytest tests/test_telecom_gp_tc.py tests/test_telecom_smoke_tc.py --headed --html=report/report.html --self-contained-html | ||||||||||||
| fi | ||||||||||||
| elif [ "${{ env.azure_env_use_case }}" == "IT_helpdesk" ]; then | ||||||||||||
| if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then | ||||||||||||
| xvfb-run pytest tests/test_ithelpdesk_gp_tc.py --headed --html=report/report.html --self-contained-html | ||||||||||||
| elif [ "${{ env.test_suite }}" == "Smoke-Testing" ]; then | ||||||||||||
| xvfb-run pytest tests/test_ithelpdesk_gp_tc.py tests/test_ithelpdesk_smoke_tc.py --headed --html=report/report.html --self-contained-html | ||||||||||||
| fi | ||||||||||||
|
||||||||||||
| fi | |
| fi | |
| else | |
| echo "ERROR: Unknown or unsupported azure_env_use_case: '${{ env.azure_env_use_case }}'. No tests were run." | |
| exit 1 |
Copilot
AI
Jan 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is significant code duplication in the test execution logic across test1, test2, and test3 steps. The same nested if-elif structure is repeated three times (lines 129-141, 154-166, 179-191). Consider extracting this logic into a reusable script or using a GitHub Actions composite action to reduce duplication and improve maintainability.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -58,6 +58,9 @@ | |||||
| }, | ||||||
| "frontendContainerRegistryHostname": { | ||||||
| "value": "${AZURE_ENV_CONTAINER_REGISTRY_ENDPOINT}" | ||||||
| }, | ||||||
| "usecase":{ | ||||||
|
||||||
| "usecase":{ | |
| "useCase":{ |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -73,6 +73,9 @@ | |||||
| }, | ||||||
| "virtualMachineAdminPassword": { | ||||||
| "value": "${AZURE_ENV_VM_ADMIN_PASSWORD}" | ||||||
| }, | ||||||
| "usecase":{ | ||||||
|
||||||
| "usecase":{ | |
| "useCase":{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image tag naming has changed from "latest" to "latest_waf" for main and default branches. This is a breaking change if there are existing deployments or scripts that rely on the "latest" tag. Ensure that all deployment documentation, external scripts, and CI/CD pipelines that reference the "latest" tag are updated to use "latest_waf" instead.