Skip to content

Commit 860bcc0

Browse files
Merge pull request #2 from Vamshi-Microsoft/vk-sm-automation
merge Vk-sm-automation into main branch
2 parents c69c9cb + 51162de commit 860bcc0

4 files changed

Lines changed: 49 additions & 15 deletions

File tree

.github/workflows/deploy-v2.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,22 @@ on:
4141
required: false
4242
default: false
4343
type: boolean
44-
run_e2e_tests:
45-
description: 'Run End-to-End Tests'
46-
required: false
47-
default: true
48-
type: boolean
44+
4945
cleanup_resources:
5046
description: 'Cleanup Deployed Resources'
5147
required: false
5248
default: false
5349
type: boolean
50+
51+
run_e2e_tests:
52+
description: 'Run End-to-End Tests'
53+
required: false
54+
default: 'GoldenPath-Testing'
55+
type: choice
56+
options:
57+
- 'GoldenPath-Testing'
58+
- 'Smoke-Testing'
59+
- 'None'
5460

5561
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
5662
description: 'Log Analytics Workspace ID (Optional)'
@@ -78,7 +84,7 @@ env:
7884
WAF_ENABLED: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.waf_enabled || false) || false }}
7985
EXP: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.EXP || false) || false }}
8086
CLEANUP_RESOURCES: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.cleanup_resources || true) || true }}
81-
RUN_E2E_TESTS: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.run_e2e_tests || true) || true }}
87+
RUN_E2E_TESTS: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }}
8288
BUILD_DOCKER_IMAGE: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build_docker_image || false) || false }}
8389

8490
jobs:
@@ -418,8 +424,8 @@ jobs:
418424
elif [[ "$BRANCH_NAME" == "dependabotchanges" ]]; then
419425
BASE_TAG="dependabotchanges"
420426
else
421-
IMAGE_TAG="pullrequest-ignore"
422-
echo "Using default for branch '$BRANCH_NAME' - image tag: pullrequest-ignore"
427+
IMAGE_TAG="latest"
428+
echo "Using default for branch '$BRANCH_NAME' - image tag: latest"
423429
fi
424430
425431
echo "Using existing Docker image tag: $IMAGE_TAG"
@@ -564,7 +570,7 @@ jobs:
564570
565571
566572
# Export variables only after successful deploy
567-
export CONTAINER_API_APPURL=$(echo "$DEPLOY_OUTPUT" | jq -r '.CONTAINER_API_APP_FQDN // empty')
573+
export CONTAINER_API_APPURL="https://$(echo "$DEPLOY_OUTPUT" | jq -r '.CONTAINER_API_APP_FQDN // empty')"
568574
echo "CONTAINER_API_APPURL=$CONTAINER_API_APPURL" >> $GITHUB_ENV
569575
570576
export CONTAINER_API_APPNAME=$(echo "$DEPLOY_OUTPUT" | jq -r '.CONTAINER_API_APP_NAME // empty')
@@ -648,11 +654,12 @@ jobs:
648654
fi
649655
650656
e2e-test:
651-
if: always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.CONTAINER_WEB_APPURL != '') || (github.event.inputs.existing_webapp_url != '' && github.event.inputs.existing_webapp_url != null)) && (github.event_name != 'workflow_dispatch' || github.event.inputs.run_e2e_tests == 'true' || github.event.inputs.run_e2e_tests == null)
657+
if: always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.CONTAINER_WEB_APPURL != '') || (github.event.inputs.existing_webapp_url != '' && github.event.inputs.existing_webapp_url != null)) && (github.event_name != 'workflow_dispatch' || (github.event.inputs.run_e2e_tests != 'none' && github.event.inputs.run_e2e_tests != '' && github.event.inputs.run_e2e_tests != null))
652658
needs: [docker-build, deploy]
653659
uses: ./.github/workflows/test-automation-v2.yml
654660
with:
655661
CP_WEB_URL: ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || github.event.inputs.existing_webapp_url }}
662+
TEST_SUITE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
656663
secrets: inherit
657664

658665
cleanup-deployment:

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

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ on:
77
required: true
88
type: string
99
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' "
1015
secrets:
1116
EMAILNOTIFICATION_LOGICAPP_URL_TA:
1217
required: false
@@ -22,6 +27,7 @@ on:
2227
env:
2328
url: ${{ inputs.CP_WEB_URL }}
2429
accelerator_name: "Content Processing"
30+
test_suite: ${{ inputs.TEST_SUITE }}
2531

2632
jobs:
2733
test:
@@ -58,6 +64,7 @@ jobs:
5864
exit 1
5965
fi
6066
echo "Testing URL: ${{ env.url }}"
67+
echo "Test Suite: ${{ env.test_suite }}"
6168
6269
6370
- name: Wait for Application to be Ready
@@ -87,7 +94,11 @@ jobs:
8794
- name: Run tests(1)
8895
id: test1
8996
run: |
90-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
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
91102
working-directory: tests/e2e-test
92103
continue-on-error: true
93104

@@ -100,7 +111,11 @@ jobs:
100111
id: test2
101112
if: ${{ steps.test1.outcome == 'failure' }}
102113
run: |
103-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
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
104119
working-directory: tests/e2e-test
105120
continue-on-error: true
106121

@@ -113,7 +128,11 @@ jobs:
113128
id: test3
114129
if: ${{ steps.test2.outcome == 'failure' }}
115130
run: |
116-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
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
117136
working-directory: tests/e2e-test
118137

119138
- name: Upload test report
@@ -127,7 +146,12 @@ jobs:
127146
- name: Generate E2E Test Summary
128147
if: always()
129148
run: |
130-
echo "## 🧪 E2E Test Job Summary" >> $GITHUB_STEP_SUMMARY
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
131155
echo "" >> $GITHUB_STEP_SUMMARY
132156
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
133157
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
@@ -141,6 +165,7 @@ jobs:
141165
fi
142166
143167
echo "| **Target URL** | [${{ env.url }}](${{ env.url }}) |" >> $GITHUB_STEP_SUMMARY
168+
echo "| **Test Suite** | \`${{ env.test_suite }}\` |" >> $GITHUB_STEP_SUMMARY
144169
echo "| **Test Report** | [Download Artifact](${{ steps.upload_report.outputs.artifact-url }}) |" >> $GITHUB_STEP_SUMMARY
145170
echo "" >> $GITHUB_STEP_SUMMARY
146171

tests/e2e-test/pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ log_file = logs/tests.log
55
log_file_level = INFO
66
addopts = -p no:warnings --tb=short
77

8+
markers =
9+
gp: Golden Path tests

tests/e2e-test/tests/test_contentProcessing_gp_tc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
logger = logging.getLogger(__name__)
1010

11-
11+
@pytest.mark.gp
1212
def test_content_processing_golden_path(login_logout, request):
1313
"""
1414
Content Processing - Validate Golden path works as expected

0 commit comments

Comments
 (0)