Refine PR test template format (#15636)

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 <chunangli@microsoft.com>
This commit is contained in:
Chun'ang Li 2023-07-10 10:47:40 +08:00 committed by GitHub
parent 9321c97731
commit c07447ae61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 111 additions and 31 deletions

View File

@ -18,6 +18,10 @@ parameters:
type: string type: string
default: 1 default: 1
- name: NUM_ASIC
type: number
default: 1
- name: TEST_SET - name: TEST_SET
type: string type: string
default: "" default: ""
@ -34,13 +38,73 @@ parameters:
type: string type: string
default: "ceos" default: "ceos"
- name: TESTBED_NAME
type: string
default: ""
- name: IMAGE_URL
type: string
default: ""
- name: HWSKU
type: string
default: ""
- name: TEST_PLAN_TYPE
type: string
default: ""
- name: PLATFORM
type: string
default: ""
- name: SCRIPTS
type: string
default: ""
- name: FEATURES
type: string
default: ""
- name: SCRIPTS_EXCLUDE
type: string
default: ""
- name: FEATURES_EXCLUDE
type: string
default: ""
- name: REPO_NAME
type: string
default: ""
- name: MGMT_BRANCH - name: MGMT_BRANCH
type: string type: string
default: master default: ""
- name: NUM_ASIC - name: STOP_ON_FAILURE
type: string
default: ""
- name: RETRY_TIMES
type: string
default: ""
- name: DUMP_KVM_IF_FAIL
type: string
default: "True"
values:
- "True"
- "False"
- name: REQUESTER
type: string
default: ""
- name: MAX_RUN_TEST_MINUTES
type: number type: number
default: 1 default: 480
steps: steps:
- script: | - script: |
@ -53,12 +117,20 @@ steps:
set -e set -e
pip install PyYAML pip install PyYAML
rm -f new_test_plan_id.txt rm -f new_test_plan_id.txt
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 }} \ python ./.azure-pipelines/test_plan.py create \
--test-set ${{ parameters.TEST_SET }} --kvm-build-id $(KVM_BUILD_ID) \ -t ${{ parameters.TOPOLOGY }} \
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" --common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \ -o new_test_plan_id.txt \
--mgmt-branch ${{ parameters.MGMT_BRANCH }} --vm-type ${{ parameters.VM_TYPE }} \ --min-worker ${{ parameters.MIN_WORKER }} \
--max-worker ${{ parameters.MAX_WORKER }} \
--test-set ${{ parameters.TEST_SET }} \
--kvm-build-id $(KVM_BUILD_ID) \
--deploy-mg-extra-params "${{ parameters.DEPLOY_MG_EXTRA_PARAMS }}" \
--common-extra-params "${{ parameters.COMMON_EXTRA_PARAMS }}" \
--mgmt-branch ${{ parameters.MGMT_BRANCH }} \
--vm-type ${{ parameters.VM_TYPE }} \
--num-asic ${{ parameters.NUM_ASIC }} --num-asic ${{ parameters.NUM_ASIC }}
TEST_PLAN_ID=`cat new_test_plan_id.txt` TEST_PLAN_ID=`cat new_test_plan_id.txt`
echo "Created test plan $TEST_PLAN_ID" echo "Created test plan $TEST_PLAN_ID"
@ -104,18 +176,20 @@ steps:
env: env:
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
displayName: Run test displayName: Run test
timeoutInMinutes: ${{ parameters.MAX_RUN_TEST_MINUTES }}
- script: | - ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}:
set -e - script: |
echo "KVM dump" set -e
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com" echo "KVM dump"
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID " echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED" echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP # When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
condition: succeededOrFailed() python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
env: condition: succeededOrFailed()
TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL) env:
displayName: KVM dump TESTBED_TOOLS_URL: $(TESTBED_TOOLS_URL)
displayName: KVM dump
- script: | - script: |
set -e set -e

View File

@ -157,6 +157,7 @@ stages:
TOPOLOGY: t0 TOPOLOGY: t0
MIN_WORKER: $(T0_INSTANCE_NUM) MIN_WORKER: $(T0_INSTANCE_NUM)
MAX_WORKER: $(T0_INSTANCE_NUM) MAX_WORKER: $(T0_INSTANCE_NUM)
MGMT_BRANCH: master
- job: t0_2vlans_elastictest - job: t0_2vlans_elastictest
pool: ubuntu-20.04 pool: ubuntu-20.04
@ -170,6 +171,7 @@ stages:
TEST_SET: t0-2vlans TEST_SET: t0-2vlans
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM) MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MGMT_BRANCH: master
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"
- job: t1_lag_elastictest - job: t1_lag_elastictest
@ -183,6 +185,7 @@ stages:
TOPOLOGY: t1-lag TOPOLOGY: t1-lag
MIN_WORKER: $(T1_LAG_INSTANCE_NUM) MIN_WORKER: $(T1_LAG_INSTANCE_NUM)
MAX_WORKER: $(T1_LAG_INSTANCE_NUM) MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
MGMT_BRANCH: master
- job: multi_asic_elastictest - job: multi_asic_elastictest
displayName: "kvmtest-multi-asic-t1-lag by Elastictest" displayName: "kvmtest-multi-asic-t1-lag by Elastictest"
@ -197,6 +200,7 @@ stages:
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM) MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM) MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
NUM_ASIC: 4 NUM_ASIC: 4
MGMT_BRANCH: master
- job: dualtor_elastictest - job: dualtor_elastictest
pool: ubuntu-20.04 pool: ubuntu-20.04
@ -209,6 +213,7 @@ stages:
TOPOLOGY: dualtor TOPOLOGY: dualtor
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM) MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM) MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MGMT_BRANCH: master
COMMON_EXTRA_PARAMS: "--disable_loganalyzer " COMMON_EXTRA_PARAMS: "--disable_loganalyzer "
- job: sonic_t0_elastictest - job: sonic_t0_elastictest
@ -223,18 +228,19 @@ stages:
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM) MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM) MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
TEST_SET: t0-sonic TEST_SET: t0-sonic
MGMT_BRANCH: master
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic " COMMON_EXTRA_PARAMS: "--neighbor_type=sonic "
VM_TYPE: vsonic VM_TYPE: vsonic
- job: wan_elastictest # - job: wan_elastictest
displayName: "kvmtest-wan by Elastictest" # displayName: "kvmtest-wan by Elastictest"
pool: ubuntu-20.04 # pool: ubuntu-20.04
timeoutInMinutes: 240 # timeoutInMinutes: 240
continueOnError: false # continueOnError: false
steps: # steps:
- template: .azure-pipelines/run-test-scheduler-template.yml # - template: .azure-pipelines/run-test-scheduler-template.yml
parameters: # parameters:
TOPOLOGY: wan-pub # TOPOLOGY: wan-pub
MIN_WORKER: $(WAN_INSTANCE_NUM) # MIN_WORKER: $(WAN_INSTANCE_NUM)
MAX_WORKER: $(WAN_INSTANCE_NUM) # MAX_WORKER: $(WAN_INSTANCE_NUM)
COMMON_EXTRA_PARAMS: "--skip_sanity " # COMMON_EXTRA_PARAMS: "--skip_sanity "