Skip to content

Commit d8126e5

Browse files
Merge remote-tracking branch 'origin/main' into psl-conflictresolve
2 parents 6ab52b5 + fd8f623 commit d8126e5

31 files changed

+2805
-150
lines changed

.github/workflows/deploy-v2.yml

Lines changed: 893 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
name: Test Automation Content Processing-v2
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
CP_WEB_URL:
7+
required: true
8+
type: string
9+
description: "Web URL for Content Processing"
10+
TEST_SUITE:
11+
required: false
12+
type: string
13+
default: "GoldenPath-Testing"
14+
description: "Test suite to run: 'Smoke-Testing', 'GoldenPath-Testing' "
15+
secrets:
16+
EMAILNOTIFICATION_LOGICAPP_URL_TA:
17+
required: false
18+
description: "Logic App URL for email notifications"
19+
outputs:
20+
TEST_SUCCESS:
21+
description: "Whether tests passed"
22+
value: ${{ jobs.test.outputs.TEST_SUCCESS }}
23+
TEST_REPORT_URL:
24+
description: "URL to test report artifact"
25+
value: ${{ jobs.test.outputs.TEST_REPORT_URL }}
26+
27+
env:
28+
url: ${{ inputs.CP_WEB_URL }}
29+
accelerator_name: "Content Processing"
30+
test_suite: ${{ inputs.TEST_SUITE }}
31+
32+
jobs:
33+
test:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
TEST_SUCCESS: ${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}
37+
TEST_REPORT_URL: ${{ steps.upload_report.outputs.artifact-url }}
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v5
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@v6
44+
with:
45+
python-version: '3.13'
46+
47+
- name: Login to Azure
48+
run: |
49+
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
50+
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
51+
52+
- name: Install dependencies
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install -r tests/e2e-test/requirements.txt
56+
57+
- name: Ensure browsers are installed
58+
run: python -m playwright install --with-deps chromium
59+
60+
- name: Validate URL
61+
run: |
62+
if [ -z "${{ env.url }}" ]; then
63+
echo "ERROR: No URL provided for testing"
64+
exit 1
65+
fi
66+
echo "Testing URL: ${{ env.url }}"
67+
echo "Test Suite: ${{ env.test_suite }}"
68+
69+
70+
- name: Wait for Application to be Ready
71+
run: |
72+
echo "Waiting for application to be ready at ${{ env.url }} "
73+
max_attempts=10
74+
attempt=1
75+
76+
while [ $attempt -le $max_attempts ]; do
77+
echo "Attempt $attempt: Checking if application is ready..."
78+
if curl -f -s "${{ env.url }}" > /dev/null; then
79+
echo "Application is ready!"
80+
break
81+
82+
fi
83+
84+
if [ $attempt -eq $max_attempts ]; then
85+
echo "Application is not ready after $max_attempts attempts"
86+
exit 1
87+
fi
88+
89+
echo "Application not ready, waiting 30 seconds..."
90+
sleep 30
91+
attempt=$((attempt + 1))
92+
done
93+
94+
- name: Run tests(1)
95+
id: test1
96+
run: |
97+
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
98+
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
99+
else
100+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
101+
fi
102+
working-directory: tests/e2e-test
103+
continue-on-error: true
104+
105+
- name: Sleep for 30 seconds
106+
if: ${{ steps.test1.outcome == 'failure' }}
107+
run: sleep 30s
108+
shell: bash
109+
110+
- name: Run tests(2)
111+
id: test2
112+
if: ${{ steps.test1.outcome == 'failure' }}
113+
run: |
114+
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
115+
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
116+
else
117+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
118+
fi
119+
working-directory: tests/e2e-test
120+
continue-on-error: true
121+
122+
- name: Sleep for 60 seconds
123+
if: ${{ steps.test2.outcome == 'failure' }}
124+
run: sleep 60s
125+
shell: bash
126+
127+
- name: Run tests(3)
128+
id: test3
129+
if: ${{ steps.test2.outcome == 'failure' }}
130+
run: |
131+
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
132+
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
133+
else
134+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
135+
fi
136+
working-directory: tests/e2e-test
137+
138+
- name: Upload test report
139+
id: upload_report
140+
uses: actions/upload-artifact@v4
141+
if: ${{ !cancelled() }}
142+
with:
143+
name: test-report
144+
path: tests/e2e-test/report/*
145+
146+
- name: Generate E2E Test Summary
147+
if: always()
148+
run: |
149+
# Determine test suite type for title
150+
if [ "${{ env.test_suite }}" == "GoldenPath-Testing" ]; then
151+
echo "## 🧪 E2E Test Job Summary : Golden Path Testing" >> $GITHUB_STEP_SUMMARY
152+
else
153+
echo "## 🧪 E2E Test Job Summary : Smoke Testing" >> $GITHUB_STEP_SUMMARY
154+
fi
155+
echo "" >> $GITHUB_STEP_SUMMARY
156+
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
157+
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
158+
159+
# Determine overall test result
160+
OVERALL_SUCCESS="${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}"
161+
if [[ "$OVERALL_SUCCESS" == "true" ]]; then
162+
echo "| **Job Status** | ✅ Success |" >> $GITHUB_STEP_SUMMARY
163+
else
164+
echo "| **Job Status** | ❌ Failed |" >> $GITHUB_STEP_SUMMARY
165+
fi
166+
167+
echo "| **Target URL** | [${{ env.url }}](${{ env.url }}) |" >> $GITHUB_STEP_SUMMARY
168+
echo "| **Test Suite** | \`${{ env.test_suite }}\` |" >> $GITHUB_STEP_SUMMARY
169+
echo "| **Test Report** | [Download Artifact](${{ steps.upload_report.outputs.artifact-url }}) |" >> $GITHUB_STEP_SUMMARY
170+
echo "" >> $GITHUB_STEP_SUMMARY
171+
172+
echo "### 📋 Test Execution Details" >> $GITHUB_STEP_SUMMARY
173+
echo "| Attempt | Status | Notes |" >> $GITHUB_STEP_SUMMARY
174+
echo "|---------|--------|-------|" >> $GITHUB_STEP_SUMMARY
175+
echo "| **Test Run 1** | ${{ steps.test1.outcome == 'success' && '✅ Passed' || '❌ Failed' }} | Initial test execution |" >> $GITHUB_STEP_SUMMARY
176+
177+
if [[ "${{ steps.test1.outcome }}" == "failure" ]]; then
178+
echo "| **Test Run 2** | ${{ steps.test2.outcome == 'success' && '✅ Passed' || steps.test2.outcome == 'failure' && '❌ Failed' || '⏸️ Skipped' }} | Retry after 30s delay |" >> $GITHUB_STEP_SUMMARY
179+
fi
180+
181+
if [[ "${{ steps.test2.outcome }}" == "failure" ]]; then
182+
echo "| **Test Run 3** | ${{ steps.test3.outcome == 'success' && '✅ Passed' || steps.test3.outcome == 'failure' && '❌ Failed' || '⏸️ Skipped' }} | Final retry after 60s delay |" >> $GITHUB_STEP_SUMMARY
183+
fi
184+
185+
echo "" >> $GITHUB_STEP_SUMMARY
186+
187+
if [[ "$OVERALL_SUCCESS" == "true" ]]; then
188+
echo "### ✅ Test Results" >> $GITHUB_STEP_SUMMARY
189+
echo "- End-to-end tests completed successfully" >> $GITHUB_STEP_SUMMARY
190+
echo "- Application is functioning as expected" >> $GITHUB_STEP_SUMMARY
191+
else
192+
echo "### ❌ Test Results" >> $GITHUB_STEP_SUMMARY
193+
echo "- All test attempts failed" >> $GITHUB_STEP_SUMMARY
194+
echo "- Check the e2e-test/test job for detailed error information" >> $GITHUB_STEP_SUMMARY
195+
fi

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ These capabilities can be applied to numerous use cases including: contract proc
1212
</div>
1313
<br/>
1414

15+
**Note:** With any AI solutions you create using these templates, you are responsible for assessing all associated risks and for complying with all applicable laws and safety standards. Learn more in the transparency documents for [Agent Service](https://learn.microsoft.com/en-us/azure/ai-foundry/responsible-ai/agents/transparency-note) and [Agent Framework](https://github.com/microsoft/agent-framework/blob/main/TRANSPARENCY_FAQ.md).
16+
<br/>
17+
1518
<h2><img src="./docs/images/readme/solution-overview.png" width="48" />
1619
Solution overview
1720
</h2>
@@ -76,14 +79,16 @@ Follow the quick deploy steps on the deployment guide to deploy this solution
7679
[Click here to launch the deployment guide](./docs/DeploymentGuide.md)
7780
<br/><br/>
7881

79-
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/content-processing-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/content-processing-solution-accelerator) |
80-
|---|---|
82+
| [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/microsoft/content-processing-solution-accelerator) | [![Open in Dev Containers](https://img.shields.io/static/v1?style=for-the-badge&label=Dev%20Containers&message=Open&color=blue&logo=visualstudiocode)](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/microsoft/content-processing-solution-accelerator) | [![Open in Visual Studio Code Web](https://img.shields.io/static/v1?style=for-the-badge&label=Visual%20Studio%20Code%20(Web)&message=Open&color=blue&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/azure/?vscode-azure-exp=foundry&agentPayload=eyJiYXNlVXJsIjogImh0dHBzOi8vcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbS9taWNyb3NvZnQvY29udGVudC1wcm9jZXNzaW5nLXNvbHV0aW9uLWFjY2VsZXJhdG9yL3JlZnMvaGVhZHMvbWFpbi9pbmZyYS92c2NvZGVfd2ViIiwgImluZGV4VXJsIjogIi9pbmRleC5qc29uIiwgInZhcmlhYmxlcyI6IHsiYWdlbnRJZCI6ICIiLCAiY29ubmVjdGlvblN0cmluZyI6ICIiLCAidGhyZWFkSWQiOiAiIiwgInVzZXJNZXNzYWdlIjogIiIsICJwbGF5Z3JvdW5kTmFtZSI6ICIiLCAibG9jYXRpb24iOiAiIiwgInN1YnNjcmlwdGlvbklkIjogIiIsICJyZXNvdXJjZUlkIjogIiIsICJwcm9qZWN0UmVzb3VyY2VJZCI6ICIiLCAiZW5kcG9pbnQiOiAiIn0sICJjb2RlUm91dGUiOiBbImFpLXByb2plY3RzLXNkayIsICJweXRob24iLCAiZGVmYXVsdC1henVyZS1hdXRoIiwgImVuZHBvaW50Il19) |
83+
|---|---|---|
8184

8285
<br/>
8386

8487
> ⚠️ **Important: Check Azure OpenAI Quota Availability**
8588
<br/>To ensure sufficient quota is available in your subscription, please follow [quota check instructions guide](./docs/quota_check.md) before you deploy the solution.
8689
90+
> 🛠️ **Need Help?** Check our [Troubleshooting Guide](./docs/TroubleShootingSteps.md) for solutions to common deployment issues.
91+
8792
<br/>
8893

8994
### Prerequisites and costs
@@ -118,6 +123,8 @@ Use the [Azure pricing calculator](https://azure.microsoft.com/en-us/pricing/cal
118123
>⚠️ **Important:** To avoid unnecessary costs, remember to take down your app if it's no longer in use,
119124
either by deleting the resource group in the Portal or running `azd down`.
120125

126+
For detailed cost estimation and pricing information, see the [Deployment Guide](./docs/DeploymentGuide.md).
127+
121128
<br /><br />
122129
<h2><img src="./docs/images/readme/business-scenario.png" width="48" />
123130
Business scenario

docs/CustomizingAzdParameters.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ By default this template will use the environment name as the prefix to prevent
1717
| `AZURE_ENV_MODEL_VERSION` | string | `2024-08-06` | Specifies the GPT model version (allowed values: `2024-08-06`). |
1818
| `AZURE_ENV_MODEL_CAPACITY` | integer | `30` | Sets the model capacity (choose based on your subscription's available GPT capacity). |
1919
| `AZURE_ENV_IMAGETAG` | boolean | `latest` | Set the Image tag Like (allowed values: latest, dev, hotfix) |
20+
| `AZURE_ENV_CONTAINER_REGISTRY_ENDPOINT` | string | `cpscontainerreg.azurecr.io` | Sets the Azure Container Registry name (allowed value: `cpscontainerreg.azurecr.io`) | |
21+
| `AZURE_LOCATION` | string | `eastus` | Sets the primary Azure region for resource deployment. |
2022
| `AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID` | string | Guide to get your [Existing Workspace ID](/docs/re-use-log-analytics.md) | Reuses an existing Log Analytics Workspace instead of provisioning a new one. |
2123
| `AZURE_EXISTING_AI_PROJECT_RESOURCE_ID` | string | `<Existing AI Project resource Id>` | Reuses an existing AIFoundry and AIFoundryProject instead of creating a new one. |
2224

0 commit comments

Comments
 (0)