-
Notifications
You must be signed in to change notification settings - Fork 189
fix: merging dev changes to main #179
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
242709f
parameterized for model version
AjitPadhi-Microsoft be512bc
Merge remote-tracking branch 'origin/main' into PSL-US-18442
AjitPadhi-Microsoft af56152
merged with main
AjitPadhi-Microsoft fb84df0
Merge pull request #147 from microsoft/PSL-US-18442
Roopan-Microsoft 96138c6
added e2e test automation scripts and pipeline
Harsh-Microsoft 7de4590
fix: update Azure CLI credentials for maintenance subscription in tes…
Harsh-Microsoft 3470eb5
fix: update Azure CLI commands to use variable references for resourc…
Harsh-Microsoft 25881c8
US:18810-Standardize Bicep Parameters for Content Processing
VishalS-Microsoft 81ff327
added CustomizingAzdParameters.md file link in DeploymentGuid.md file
VishalS-Microsoft 2718c97
fix: restore paths configuration for e2e tests in test automation wor…
Harsh-Microsoft 00d289d
Merge pull request #177 from microsoft/psl-us18810-cps
Roopan-Microsoft a0d9cd1
test: Migrate test automation scripts and pipeline for content proces…
Avijit-Microsoft fad756e
image tage changes
VishalS-Microsoft ff29f76
Merge branch 'main' into dev
AjitPadhi-Microsoft a375147
image tag changes
VishalS-Microsoft bd3776b
Merge branch 'dev' into psl-imagetag-changes
VishalS-Microsoft 7584597
resolved comments
VishalS-Microsoft 4c98065
Update docs/CustomizingAzdParameters.md
Roopan-Microsoft 664c285
Merge pull request #180 from microsoft/psl-imagetag-changes
Prajwal-Microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| name: Test Automation Content Processing | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - dev | ||
| paths: | ||
| - 'tests/e2e-test/**' | ||
| schedule: | ||
| - cron: '0 13 * * *' # Runs at 1 PM UTC | ||
| workflow_dispatch: | ||
|
|
||
| env: | ||
| url: ${{ vars.CP_WEB_URL }} | ||
| accelerator_name: "Content Processing" | ||
|
|
||
| jobs: | ||
| test: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Azure CLI Login | ||
| uses: azure/login@v2 | ||
| with: | ||
| creds: '{"clientId":"${{ secrets.AZURE_MAINTENANCE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_MAINTENANCE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}' | ||
|
|
||
| - name: Start Container App | ||
| id: start-container-app | ||
| uses: azure/cli@v2 | ||
| with: | ||
| azcliversion: 'latest' | ||
| inlineScript: | | ||
| az rest -m post -u "/subscriptions/${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CP_RG }}/providers/Microsoft.App/containerApps/${{ vars.CP_CONTAINERAPP_PREFIX }}-app/start?api-version=2025-01-01" | ||
| az rest -m post -u "/subscriptions/${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CP_RG }}/providers/Microsoft.App/containerApps/${{ vars.CP_CONTAINERAPP_PREFIX }}-api/start?api-version=2025-01-01" | ||
| az rest -m post -u "/subscriptions/${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CP_RG }}/providers/Microsoft.App/containerApps/${{ vars.CP_CONTAINERAPP_PREFIX }}-web/start?api-version=2025-01-01" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -r tests/e2e-test/requirements.txt | ||
|
|
||
| - name: Ensure browsers are installed | ||
| run: python -m playwright install --with-deps chromium | ||
|
|
||
| - name: Run tests(1) | ||
| id: test1 | ||
| run: | | ||
| xvfb-run pytest --headed --html=report/report.html --self-contained-html | ||
| working-directory: tests/e2e-test | ||
| continue-on-error: true | ||
|
|
||
| - name: Sleep for 30 seconds | ||
| if: ${{ steps.test1.outcome == 'failure' }} | ||
| run: sleep 30s | ||
| shell: bash | ||
|
|
||
| - name: Run tests(2) | ||
| id: test2 | ||
| if: ${{ steps.test1.outcome == 'failure' }} | ||
| run: | | ||
| xvfb-run pytest --headed --html=report/report.html --self-contained-html | ||
| working-directory: tests/e2e-test | ||
| continue-on-error: true | ||
|
|
||
| - name: Sleep for 60 seconds | ||
| if: ${{ steps.test2.outcome == 'failure' }} | ||
| run: sleep 60s | ||
| shell: bash | ||
|
|
||
| - name: Run tests(3) | ||
| id: test3 | ||
| if: ${{ steps.test2.outcome == 'failure' }} | ||
| run: | | ||
| xvfb-run pytest --headed --html=report/report.html --self-contained-html | ||
| working-directory: tests/e2e-test | ||
|
|
||
| - name: Upload test report | ||
| id: upload_report | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ !cancelled() }} | ||
| with: | ||
| name: test-report | ||
| path: tests/e2e-test/report/* | ||
|
|
||
| - name: Send Notification | ||
| if: always() | ||
| run: | | ||
| RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
| REPORT_URL=${{ steps.upload_report.outputs.artifact-url }} | ||
| IS_SUCCESS=${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }} | ||
| # Construct the email body | ||
| if [ "$IS_SUCCESS" = "true" ]; then | ||
| EMAIL_BODY=$(cat <<EOF | ||
| { | ||
| "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>", | ||
| "subject": "${{ env.accelerator_name }} Test Automation - Success" | ||
| } | ||
| EOF | ||
| ) | ||
| else | ||
| EMAIL_BODY=$(cat <<EOF | ||
| { | ||
| "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> ${OUTPUT}</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>", | ||
| "subject": "${{ env.accelerator_name }} Test Automation - Failure" | ||
| } | ||
| EOF | ||
| ) | ||
| fi | ||
|
|
||
| # Send the notification | ||
| curl -X POST "${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}" \ | ||
| -H "Content-Type: application/json" \ | ||
| -d "$EMAIL_BODY" || echo "Failed to send notification" | ||
|
|
||
| - name: Stop Container App | ||
| if: always() | ||
| uses: azure/cli@v2 | ||
| with: | ||
| azcliversion: 'latest' | ||
| inlineScript: | | ||
| az rest -m post -u "/subscriptions/${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CP_RG }}/providers/Microsoft.App/containerApps/${{ vars.CP_CONTAINERAPP_PREFIX }}-app/stop?api-version=2025-01-01" | ||
| az rest -m post -u "/subscriptions/${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CP_RG }}/providers/Microsoft.App/containerApps/${{ vars.CP_CONTAINERAPP_PREFIX }}-api/stop?api-version=2025-01-01" | ||
| az rest -m post -u "/subscriptions/${{ secrets.AZURE_MAINTENANCE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.CP_RG }}/providers/Microsoft.App/containerApps/${{ vars.CP_CONTAINERAPP_PREFIX }}-web/stop?api-version=2025-01-01" | ||
| az logout |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,11 @@ | ||
| using './main.bicep' | ||
|
|
||
| param environmentName = readEnvironmentVariable('AZURE_ENV_NAME', 'cps') | ||
| param secondaryLocation = readEnvironmentVariable('AZURE_ENV_SECONDARY_LOCATION', 'EastUs2') | ||
| param contentUnderstandingLocation = readEnvironmentVariable('AZURE_ENV_CU_LOCATION', 'WestUS') | ||
| param deploymentType = readEnvironmentVariable('AZURE_ENV_MODEL_DEPLOYMENT_TYPE', 'GlobalStandard') | ||
| param gptModelName = readEnvironmentVariable('AZURE_ENV_MODEL_NAME', 'gpt-4o') | ||
| param gptModelVersion = readEnvironmentVariable('AZURE_ENV_MODEL_VERSION', '2024-08-06') | ||
| param gptDeploymentCapacity = int(readEnvironmentVariable('AZURE_ENV_MODEL_CAPACITY', '30')) | ||
| param useLocalBuild = readEnvironmentVariable('USE_LOCAL_BUILD', 'false') | ||
| param existingLogAnalyticsWorkspaceId = readEnvironmentVariable('AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.