Skip to content

Commit 4e628f0

Browse files
authored
Refine PR test template format (#15637)
Why I did it Refine PR test template format. How I did it Refine PR test template format. How to verify it PR test executed normally. Signed-off-by: Chun'ang Li <[email protected]>
1 parent 6e7c000 commit 4e628f0

File tree

1 file changed

+100
-17
lines changed

1 file changed

+100
-17
lines changed

.azure-pipelines/run-test-scheduler-template.yml

+100-17
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ parameters:
1616

1717
- name: MAX_WORKER
1818
type: string
19-
default: 2
19+
default: 1
20+
21+
- name: NUM_ASIC
22+
type: number
23+
default: 1
2024

2125
- name: TEST_SET
2226
type: string
@@ -26,14 +30,82 @@ parameters:
2630
type: string
2731
default: ""
2832

33+
- name: COMMON_EXTRA_PARAMS
34+
type: string
35+
default: ""
36+
37+
- name: VM_TYPE
38+
type: string
39+
default: "ceos"
40+
41+
- name: TESTBED_NAME
42+
type: string
43+
default: ""
44+
45+
- name: IMAGE_URL
46+
type: string
47+
default: ""
48+
49+
- name: HWSKU
50+
type: string
51+
default: ""
52+
53+
- name: TEST_PLAN_TYPE
54+
type: string
55+
default: ""
56+
57+
- name: PLATFORM
58+
type: string
59+
default: ""
60+
61+
- name: SCRIPTS
62+
type: string
63+
default: ""
64+
65+
- name: FEATURES
66+
type: string
67+
default: ""
68+
69+
- name: SCRIPTS_EXCLUDE
70+
type: string
71+
default: ""
72+
73+
- name: FEATURES_EXCLUDE
74+
type: string
75+
default: ""
76+
77+
- name: REPO_NAME
78+
type: string
79+
default: ""
80+
2981
- name: MGMT_BRANCH
3082
type: string
31-
default: master
83+
default: ""
3284

33-
- name: COMMON_EXTRA_PARAMS
85+
- name: STOP_ON_FAILURE
86+
type: string
87+
default: ""
88+
89+
- name: RETRY_TIMES
3490
type: string
3591
default: ""
3692

93+
- name: DUMP_KVM_IF_FAIL
94+
type: string
95+
default: "True"
96+
values:
97+
- "True"
98+
- "False"
99+
100+
- name: REQUESTER
101+
type: string
102+
default: ""
103+
104+
- name: MAX_RUN_TEST_MINUTES
105+
type: number
106+
default: 480
107+
108+
37109
steps:
38110
- script: |
39111
set -e
@@ -46,9 +118,18 @@ steps:
46118
set -e
47119
pip install PyYAML
48120
rm -f new_test_plan_id.txt
49-
python ./.azure-pipelines/test_plan.py create -t ${{ parameters.TOPOLOGY }} -o new_test_plan_id.txt --min-worker ${{ parameters.MIN_WORKER }} --max-worker ${{ parameters.MAX_WORKER }} \
50-
--test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) --deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" --mgmt-branch ${{ parameters.MGMT_BRANCH }} \
121+
122+
python ./.azure-pipelines/test_plan.py create \
123+
-t ${{ parameters.TOPOLOGY }} \
124+
-o new_test_plan_id.txt \
125+
--min-worker ${{ parameters.MIN_WORKER }} \
126+
--max-worker ${{ parameters.MAX_WORKER }} \
127+
--test-set ${{ parameters.TEST_SET }} \
128+
--kvm-build-id $(KVM_BUILD_ID) \
129+
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \
130+
--mgmt-branch ${{ parameters.MGMT_BRANCH }} \
51131
--common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}"
132+
52133
TEST_PLAN_ID=`cat new_test_plan_id.txt`
53134
54135
echo "Created test plan $TEST_PLAN_ID"
@@ -94,18 +175,20 @@ steps:
94175
env:
95176
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
96177
displayName: Run test
97-
98-
- script: |
99-
set -e
100-
echo "KVM dump"
101-
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to [email protected]"
102-
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
103-
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
104-
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
105-
condition: succeededOrFailed()
106-
env:
107-
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
108-
displayName: KVM dump
178+
timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }}
179+
180+
- ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}:
181+
- script: |
182+
set -e
183+
echo "KVM dump"
184+
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to [email protected]"
185+
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
186+
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
187+
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
188+
condition: succeededOrFailed()
189+
env:
190+
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
191+
displayName: KVM dump
109192
110193
- script: |
111194
set -e

0 commit comments

Comments
 (0)