From 9764ec297e61c89f19f6ea6bbbaf7bfa735ac73d Mon Sep 17 00:00:00 2001 From: Ye Jianquan Date: Wed, 24 May 2023 10:26:49 +0800 Subject: [PATCH] Refine test job definition and assert logic (#14961) 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 --- azure-pipelines.yml | 82 ++++++--------------------------------------- 1 file changed, 10 insertions(+), 72 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ff62e1af43..da8be896f3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -174,8 +174,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')) @@ -188,8 +187,7 @@ stages: MAX_WORKER: $(T0_INSTANCE_NUM) - 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')) @@ -203,39 +201,6 @@ stages: MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM) DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a" - - job: - pool: - vmImage: 'ubuntu-20.04' - displayName: "kvmtest-t0" - dependsOn: - - t0_part1 - - t0_part2 - - t0_testbedv2 - - t0_2vlans_testbedv2 - condition: always() - continueOnError: false - 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" @@ -252,8 +217,7 @@ stages: vmtype: ceos - 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')) @@ -265,34 +229,12 @@ stages: MIN_WORKER: $(T1_LAG_INSTANCE_NUM) MAX_WORKER: $(T1_LAG_INSTANCE_NUM) - - 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 [ $(resultOfClassic) == "Succeeded" ] || [ $(resultOfTestbedV2) == "Succeeded" ]; then - echo "One or both of t1_lag_classic and t1_lag_testbedv2 passed." - exit 0 - else - echo "Both t1_lag_classic and t1_lag_testbedv2 failed! Please check the detailed information." - exit 1 - fi - - job: pool: sonictest-sonic-t0 displayName: "kvmtest-t0-sonic" timeoutInMinutes: 360 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_CLASSICAL_TEST, 'YES')) - continueOnError: true + continueOnError: false steps: - template: .azure-pipelines/run-test-template.yml parameters: @@ -307,7 +249,7 @@ stages: displayName: "kvmtest-multi-asic-t1-lag" timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_CLASSICAL_TEST, 'YES')) - continueOnError: true + continueOnError: false steps: - template: .azure-pipelines/run-test-template.yml parameters: @@ -318,9 +260,8 @@ stages: image: sonic-4asic-vs.img.gz - job: multi_asic_testbedv2 + pool: ubuntu-20.04 displayName: "kvmtest-multi-asic-t1-lag by TestbedV2" - pool: - vmImage: 'ubuntu-20.04' timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) continueOnError: false @@ -334,8 +275,7 @@ stages: NUM_ASIC: 4 - 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')) @@ -349,9 +289,8 @@ stages: COMMON_EXTRA_PARAMS: "--disable_loganalyzer " - job: sonic_t0_testbedv2 + pool: ubuntu-20.04 displayName: "kvmtest-t0-sonic by TestbedV2" - pool: - vmImage: 'ubuntu-20.04' timeoutInMinutes: 240 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) continueOnError: false @@ -367,12 +306,11 @@ stages: SPECIFIED_PARAMS: '{\"test_pretest.py\":[\"--completeness_level=confident\",\"--allow_recover\"],\"test_posttest.py\":[\"--completeness_level=confident\",\"--allow_recover\"]}' - job: wan_testbedv2 + pool: ubuntu-20.04 displayName: "kvmtest-wan by TestbedV2" - pool: - vmImage: 'ubuntu-20.04' timeoutInMinutes: 1080 condition: and(succeeded(), eq(variables.BUILD_IMG_RUN_TESTBEDV2_TEST, 'YES')) - continueOnError: true + continueOnError: false steps: - template: .azure-pipelines/run-test-scheduler-template.yml parameters: