Refine test job definition and assert logic (#14959)

Why I did it
Remove 'kvmtest-t0' and 'kvmtest-t1-lag' test jobs since all the test jobs are required (continueOnError: false) already, and will only enable one of classical and testbedV2 tests, no need to do an unnecessary 'or' compute test job.
Change agent pool to reduce cost and avoid congestion
This commit is contained in:
Ye Jianquan 2023-05-24 10:27:04 +08:00 committed by GitHub
parent 59b89ee7c3
commit 978db8e9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,8 +163,7 @@ stages:
section: part-2
- job: t0_testbedv2
pool:
vmImage: 'ubuntu-20.04'
pool: ubuntu-20.04
displayName: "kvmtest-t0 by TestbedV2"
timeoutInMinutes: 240
condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES'))
@ -178,8 +177,7 @@ stages:
MGMT_BRANCH: 202012
- job: t0_2vlans_testbedv2
pool:
vmImage: 'ubuntu-20.04'
pool: ubuntu-20.04
displayName: "kvmtest-t0-2vlans by TestbedV2"
timeoutInMinutes: 240
condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES'))
@ -194,38 +192,6 @@ stages:
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"
MGMT_BRANCH: 202012
- job:
pool:
vmImage: 'ubuntu-20.04'
displayName: "kvmtest-t0"
dependsOn:
- t0_part1
- t0_part2
- t0_testbedv2
- t0_2vlans_testbedv2
condition: always()
variables:
resultOfPart1: $[ dependencies.t0_part1.result ]
resultOfPart2: $[ dependencies.t0_part2.result ]
resultOfT0TestbedV2: $[ dependencies.t0_testbedv2.result ]
resultOfT02VlansTestbedV2: $[ dependencies.t0_2vlans_testbedv2.result ]
steps:
- script: |
if [ $(resultOfT0TestbedV2) == "Succeeded" ] && [ $(resultOfT02VlansTestbedV2) == "Succeeded" ]; then
echo "TestbedV2 t0 passed."
exit 0
fi
if [ $(resultOfPart1) == "Succeeded" ] && [ $(resultOfPart2) == "Succeeded" ]; then
echo "Classic t0 jobs(both part1 and part2) passed."
exit 0
fi
echo "Both classic and TestbedV2 t0 jobs failed! Please check the detailed information. (Any of them passed, t0 will be considered as passed)"
exit 1
- job: t1_lag_classic
pool: sonictest-t1-lag
displayName: "kvmtest-t1-lag classic"
@ -241,8 +207,7 @@ stages:
tbtype: t1-lag
- job: t1_lag_testbedv2
pool:
vmImage: 'ubuntu-20.04'
pool: ubuntu-20.04
displayName: "kvmtest-t1-lag by TestbedV2"
timeoutInMinutes: 240
condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES'))
@ -255,36 +220,8 @@ stages:
MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
MGMT_BRANCH: 202012
- job:
pool:
vmImage: 'ubuntu-20.04'
displayName: "kvmtest-t1-lag"
dependsOn:
- t1_lag_classic
- t1_lag_testbedv2
condition: always()
continueOnError: false
variables:
resultOfClassic: $[ dependencies.t1_lag_classic.result ]
resultOfTestbedV2: $[ dependencies.t1_lag_testbedv2.result ]
steps:
- script: |
if [ $(resultOfTestbedV2) == "Succeeded" ]; then
echo "TestbedV2 t1-lag passed."
exit 0
fi
if [ $(resultOfClassic) == "Succeeded" ]; then
echo "Classic t1-lag passed."
exit 0
fi
echo "Both classic and TestbedV2 t1-lag jobs failed! Please check the detailed information. (Any of them passed, t1-lag will be considered as passed)"
exit 1
- job: dualtor_testbedv2
pool:
vmImage: 'ubuntu-20.04'
pool: ubuntu-20.04
displayName: "kvmtest-dualtor-t0 by TestbedV2"
timeoutInMinutes: 240
condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES'))