Skip to content

Commit

Permalink
[Baseline] Build baseline test pipeline (sonic-net#10872)
Browse files Browse the repository at this point in the history
* Create baseline test pipeline yaml
  • Loading branch information
xwjiang-ms authored Nov 29, 2023
1 parent 7f4be9b commit 25af02e
Show file tree
Hide file tree
Showing 4 changed files with 221 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: BaselineTest_$(Build.DefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

trigger: none
pr: none

schedules:
- cron: "0 4 * * *"
displayName: Baseline test Scheduler
branches:
include:
- master
always: true

stages:
- stage: Pre_test
variables:
- group: GIT_SECRETS
jobs:
- job: validate_test_cases
displayName: "Validate Test Cases"
timeoutInMinutes: 20
continueOnError: false
pool: ubuntu-20.04
steps:
- template: ../../pytest-collect-only.yml

- stage: Test_round_1
dependsOn:
- Pre_test
condition: succeeded('Pre_test')
jobs:
- template: baseline.test.template.yml

- stage: Test_round_2
dependsOn:
- Pre_test
- Test_round_1
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_1'))
jobs:
- template: baseline.test.template.yml

- stage: Test_round_3
dependsOn:
- Pre_test
- Test_round_2
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_2'))
jobs:
- template: baseline.test.template.yml

- stage: Test_round_4
dependsOn:
- Pre_test
- Test_round_3
condition: and(succeeded('Pre_test'), succeededOrFailed('Test_round_3'))
jobs:
- template: baseline.test.template.yml
149 changes: 149 additions & 0 deletions .azure-pipelines/baseline_test/baseline.test.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
variables:
- group: SONiC-Elastictest
- name: inventory
value: veos_vtb
- name: testbed_file
value: vtestbed.yaml
- group: GIT_SECRETS

jobs:
- job: t0_elastictest
displayName: "kvmtest-t0 by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t0
MIN_WORKER: $(T0_INSTANCE_NUM)
MAX_WORKER: $(T0_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"

- job: t0_2vlans_elastictest
displayName: "kvmtest-t0-2vlans by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t0
TEST_SET: t0-2vlans
MIN_WORKER: $(T0_2VLANS_INSTANCE_NUM)
MAX_WORKER: $(T0_2VLANS_INSTANCE_NUM)
DEPLOY_MG_EXTRA_PARAMS: "-e vlan_config=two_vlan_a"
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"

- job: t1_lag_elastictest
displayName: "kvmtest-t1-lag by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t1-lag
MIN_WORKER: $(T1_LAG_INSTANCE_NUM)
MAX_WORKER: $(T1_LAG_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"

- job: dualtor_elastictest
displayName: "kvmtest-dualtor-t0 by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: dualtor
MIN_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
MAX_WORKER: $(T0_DUALTOR_INSTANCE_NUM)
COMMON_EXTRA_PARAMS: "--disable_loganalyzer "
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"

- job: multi_asic_elastictest
displayName: "kvmtest-multi-asic-t1-lag by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t1-8-lag
TEST_SET: multi-asic-t1-lag
MIN_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
MAX_WORKER: $(MULTI_ASIC_INSTANCE_NUM)
NUM_ASIC: 4
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"

- job: sonic_t0_elastictest
displayName: "kvmtest-t0-sonic by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: t0-64-32
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
TEST_SET: t0-sonic
COMMON_EXTRA_PARAMS: "--neighbor_type=sonic "
VM_TYPE: vsonic
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"

- job: dpu_elastictest
displayName: "kvmtest-dpu by Elastictest"
timeoutInMinutes: 240
continueOnError: false
pool: ubuntu-20.04
strategy:
parallel: $(BASELINE_MGMT_PUBLIC_MASTER_TEST_NUM)
steps:
- template: ../../run-test-elastictest-template.yml
parameters:
TOPOLOGY: dpu
MIN_WORKER: $(T0_SONIC_INSTANCE_NUM)
MAX_WORKER: $(T0_SONIC_INSTANCE_NUM)
KVM_IMAGE_BRANCH: "master"
MGMT_BRANCH: "master"
BUILD_REASON: "BaselineTest"
RETRY_TIMES: "0"
STOP_ON_FAILURE: "False"
5 changes: 5 additions & 0 deletions .azure-pipelines/run-test-elastictest-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ parameters:
type: string
default: "[]"

- name: BUILD_REASON
type: string
default: ""

- name: REPO_NAME
type: string
default: ""
Expand Down Expand Up @@ -195,6 +199,7 @@ steps:
--features-exclude "${{ parameters.FEATURES_EXCLUDE }}" \
--specific-param='${{ parameters.SPECIFIC_PARAM }}' \
--affinity='${{ parameters.AFFINITY }}' \
--build-reason ${{ parameters.BUILD_REASON }} \
--repo-name ${{ parameters.REPO_NAME }} \
--mgmt-branch ${{ parameters.MGMT_BRANCH }} \
--stop-on-failure ${{ parameters.STOP_ON_FAILURE }} \
Expand Down
12 changes: 11 additions & 1 deletion .azure-pipelines/test_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,16 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state="", expecte
required=False,
help="The asic number of dut"
)
parser_create.add_argument(
"--build-reason",
type=str,
dest="build_reason",
nargs='?',
const=None,
default=None,
required=False,
help="Build reason"
)
parser_create.add_argument(
"--repo-name",
type=str,
Expand Down Expand Up @@ -840,7 +850,7 @@ def poll(self, test_plan_id, interval=60, timeout=-1, expected_state="", expecte
pr_id = os.environ.get("SYSTEM_PULLREQUEST_PULLREQUESTNUMBER") or os.environ.get(
"SYSTEM_PULLREQUEST_PULLREQUESTID")
repo = os.environ.get("BUILD_REPOSITORY_PROVIDER")
reason = os.environ.get("BUILD_REASON")
reason = args.build_reason if args.build_reason else os.environ.get("BUILD_REASON")
build_id = os.environ.get("BUILD_BUILDID")
job_name = os.environ.get("SYSTEM_JOBDISPLAYNAME")
repo_name = args.repo_name if args.repo_name else os.environ.get("BUILD_REPOSITORY_NAME")
Expand Down

0 comments on commit 25af02e

Please sign in to comment.