Skip to content

Commit 3602aec

Browse files
Added input paramter for Gp and Smoke Testing
1 parent c69c9cb commit 3602aec

4 files changed

Lines changed: 47 additions & 9 deletions

File tree

.github/workflows/deploy-v2.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ on:
4444
run_e2e_tests:
4545
description: 'Run End-to-End Tests'
4646
required: false
47-
default: true
48-
type: boolean
47+
default: 'GoldenPath-Testing'
48+
type: choice
49+
options:
50+
- 'GoldenPath-Testing'
51+
- 'Smoke-Testing'
52+
- 'None'
4953
cleanup_resources:
5054
description: 'Cleanup Deployed Resources'
5155
required: false
@@ -78,7 +82,7 @@ env:
7882
WAF_ENABLED: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.waf_enabled || false) || false }}
7983
EXP: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.EXP || false) || false }}
8084
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 }}
85+
RUN_E2E_TESTS: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.run_e2e_tests || 'GoldenPath-Testing') || 'GoldenPath-Testing' }}
8286
BUILD_DOCKER_IMAGE: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build_docker_image || false) || false }}
8387

8488
jobs:
@@ -648,11 +652,12 @@ jobs:
648652
fi
649653
650654
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)
655+
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))
652656
needs: [docker-build, deploy]
653657
uses: ./.github/workflows/test-automation-v2.yml
654658
with:
655659
CP_WEB_URL: ${{ needs.deploy.outputs.CONTAINER_WEB_APPURL || github.event.inputs.existing_webapp_url }}
660+
TEST_SUITE: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_e2e_tests || 'GoldenPath-Testing' }}
656661
secrets: inherit
657662

658663
cleanup-deployment:

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

Lines changed: 35 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,13 @@ 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 }}" == "gp" ]; then
98+
echo "Running Golden Path Tests..."
99+
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
100+
else
101+
echo "Running All Tests..."
102+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
103+
fi
91104
working-directory: tests/e2e-test
92105
continue-on-error: true
93106

@@ -100,7 +113,13 @@ jobs:
100113
id: test2
101114
if: ${{ steps.test1.outcome == 'failure' }}
102115
run: |
103-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
116+
if [ "${{ env.test_suite }}" == "gp" ]; then
117+
echo "Running Golden Path Tests..."
118+
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
119+
else
120+
echo "Running All Tests..."
121+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
122+
fi
104123
working-directory: tests/e2e-test
105124
continue-on-error: true
106125

@@ -113,7 +132,13 @@ jobs:
113132
id: test3
114133
if: ${{ steps.test2.outcome == 'failure' }}
115134
run: |
116-
xvfb-run pytest --headed --html=report/report.html --self-contained-html
135+
if [ "${{ env.test_suite }}" == "gp" ]; then
136+
echo "Running Golden Path Tests..."
137+
xvfb-run pytest -m gp --headed --html=report/report.html --self-contained-html
138+
else
139+
echo "Running All Tests..."
140+
xvfb-run pytest --headed --html=report/report.html --self-contained-html
141+
fi
117142
working-directory: tests/e2e-test
118143

119144
- name: Upload test report
@@ -127,7 +152,12 @@ jobs:
127152
- name: Generate E2E Test Summary
128153
if: always()
129154
run: |
130-
echo "## 🧪 E2E Test Job Summary" >> $GITHUB_STEP_SUMMARY
155+
# Determine test suite type for title
156+
if [ "${{ env.test_suite }}" == "gp" ]; then
157+
echo "## 🧪 E2E Test Job Summary : Golden Path testing" >> $GITHUB_STEP_SUMMARY
158+
else
159+
echo "## 🧪 E2E Test Job Summary : Smoke testing" >> $GITHUB_STEP_SUMMARY
160+
fi
131161
echo "" >> $GITHUB_STEP_SUMMARY
132162
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
133163
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
@@ -141,6 +171,7 @@ jobs:
141171
fi
142172
143173
echo "| **Target URL** | [${{ env.url }}](${{ env.url }}) |" >> $GITHUB_STEP_SUMMARY
174+
echo "| **Test Suite** | \`${{ env.test_suite }}\` |" >> $GITHUB_STEP_SUMMARY
144175
echo "| **Test Report** | [Download Artifact](${{ steps.upload_report.outputs.artifact-url }}) |" >> $GITHUB_STEP_SUMMARY
145176
echo "" >> $GITHUB_STEP_SUMMARY
146177

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)