2022-10-19 00:33:17 -05:00
parameters :
- name : TOPOLOGY
type : string
- name : POLL_INTERVAL
type : number
default : 10
- name : POLL_TIMEOUT
type : number
default : 36000
- name : MIN_WORKER
2022-12-05 20:17:15 -06:00
type : string
2022-10-19 00:33:17 -05:00
default : 1
- name : MAX_WORKER
2022-12-05 20:17:15 -06:00
type : string
2022-11-30 08:36:55 -06:00
default : 1
2022-10-19 00:33:17 -05:00
2023-07-09 21:49:22 -05:00
- name : NUM_ASIC
type : number
default : 1
2022-10-19 00:33:17 -05:00
- name : TEST_SET
type : string
default : ""
- name : DEPLOY_MG_EXTRA_PARAMS
type : string
default : ""
2022-11-07 05:48:06 -06:00
- name : COMMON_EXTRA_PARAMS
type : string
default : ""
2022-11-10 01:27:31 -06:00
- name : VM_TYPE
type : string
default : "ceos"
2023-07-09 21:49:22 -05:00
- 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 : ""
2022-11-10 01:27:31 -06:00
- name : MGMT_BRANCH
type : string
2023-07-09 21:49:22 -05:00
default : ""
- name : STOP_ON_FAILURE
type : string
default : ""
2022-11-10 01:27:31 -06:00
2023-07-09 21:49:22 -05:00
- 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
2022-11-10 20:54:37 -06:00
type : number
2023-07-09 21:49:22 -05:00
default : 480
2022-11-10 20:54:37 -06:00
2022-10-19 00:33:17 -05:00
steps :
- script : |
2023-07-09 21:49:22 -05:00
set -e
2022-10-19 00:33:17 -05:00
wget -O ./.azure-pipelines/test_plan.py https://raw.githubusercontent.com/sonic-net/sonic-mgmt/master/.azure-pipelines/test_plan.py
wget -O ./.azure-pipelines/pr_test_scripts.yaml https://raw.githubusercontent.com/sonic-net/sonic-mgmt/master/.azure-pipelines/pr_test_scripts.yaml
2023-06-02 03:33:41 -05:00
displayName : Download test plan scripts
2022-10-19 00:33:17 -05:00
- script : |
2023-07-09 21:49:22 -05:00
set -e
2022-10-19 00:33:17 -05:00
pip install PyYAML
rm -f new_test_plan_id.txt
2023-07-09 21:49:22 -05:00
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 }} \
--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 }} \
2022-11-10 20:54:37 -06:00
--num-asic ${{ parameters.NUM_ASIC }}
2023-07-09 21:49:22 -05:00
2022-10-19 00:33:17 -05:00
TEST_PLAN_ID=`cat new_test_plan_id.txt`
echo "Created test plan $TEST_PLAN_ID"
2023-07-09 21:49:22 -05:00
echo "Check $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID for test plan status"
2022-10-19 00:33:17 -05:00
echo "##vso[task.setvariable variable=TEST_PLAN_ID]$TEST_PLAN_ID"
env :
TESTBED_TOOLS_URL : $(TESTBED_TOOLS_URL)
TENANT_ID : $(TESTBED_TOOLS_MSAL_TENANT_ID)
CLIENT_ID : $(TESTBED_TOOLS_MSAL_CLIENT_ID)
CLIENT_SECRET : $(TESTBED_TOOLS_MSAL_CLIENT_SECRET)
displayName : Trigger test
- script : |
2023-07-09 21:49:22 -05:00
set -e
2022-10-19 00:33:17 -05:00
echo "Lock testbed"
2023-06-02 03:33:41 -05:00
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
2023-05-30 20:37:38 -05:00
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
2022-10-19 00:33:17 -05:00
# When "LOCK_TESTBED" finish, it changes into "PREPARE_TESTBED"
Improve the display of pipeline. (#13127)
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.
Why I did it
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.
How I did it
Each step has its own signature of success or failure.
Using the chain of responsibility pattern to manage all status.
Modify the expected-state in each step.
2023-01-04 03:12:23 -06:00
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state LOCK_TESTBED
2022-10-19 00:33:17 -05:00
env :
TESTBED_TOOLS_URL : $(TESTBED_TOOLS_URL)
displayName : Lock testbed
- script : |
2023-07-09 21:49:22 -05:00
set -e
2022-10-19 00:33:17 -05:00
echo "Prepare testbed"
2023-06-02 03:33:41 -05:00
echo "Preparing the testbed(add-topo, deploy-mg) may take 15-30 minutes. Before the testbed is ready, the progress of the test plan keeps displayed as 0, please be patient"
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
2023-05-30 20:37:38 -05:00
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
2022-10-19 00:33:17 -05:00
# When "PREPARE_TESTBED" finish, it changes into "EXECUTING"
Improve the display of pipeline. (#13127)
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.
Why I did it
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.
How I did it
Each step has its own signature of success or failure.
Using the chain of responsibility pattern to manage all status.
Modify the expected-state in each step.
2023-01-04 03:12:23 -06:00
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state PREPARE_TESTBED
2022-10-19 00:33:17 -05:00
env :
TESTBED_TOOLS_URL : $(TESTBED_TOOLS_URL)
displayName : Prepare testbed
- script : |
2023-07-09 21:49:22 -05:00
set -e
2022-10-19 00:33:17 -05:00
echo "Run test"
2023-06-02 03:33:41 -05:00
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
2023-05-30 20:37:38 -05:00
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
2022-10-19 00:33:17 -05:00
# When "EXECUTING" finish, it changes into "KVMDUMP", "FAILED", "CANCELLED" or "FINISHED"
Improve the display of pipeline. (#13127)
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.
Why I did it
The display of azure pipeline is not specific now, such as when the step Run test fails, the display of itself shows successful, but the display of step Kvmdump shows fails, but actually, the step Kvmdump doesn't fail. I improve the display of azure pipeline in this pr, each step has its own success or failure, and is shown in azure pipeline.
How I did it
Each step has its own signature of success or failure.
Using the chain of responsibility pattern to manage all status.
Modify the expected-state in each step.
2023-01-04 03:12:23 -06:00
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state EXECUTING
2022-10-19 00:33:17 -05:00
env :
TESTBED_TOOLS_URL : $(TESTBED_TOOLS_URL)
displayName : Run test
2023-07-09 21:49:22 -05:00
timeoutInMinutes : ${{ parameters.MAX_RUN_TEST_MINUTES }}
- ${{ if eq(parameters.DUMP_KVM_IF_FAIL, 'True') }}:
- script : |
set -e
echo "KVM dump"
echo "SONiC PR system-level test is powered by SONiC Elastictest, for any issue, please send email to sonicelastictest@microsoft.com"
echo "Runtime detailed progress at $(FRONTEND_URL)/scheduler/testplan/$TEST_PLAN_ID "
# When "KVMDUMP" finish, it changes into "FAILED", "CANCELLED" or "FINISHED"
python ./.azure-pipelines/test_plan.py poll -i "$(TEST_PLAN_ID)" --expected-state KVMDUMP
condition : succeededOrFailed()
env :
TESTBED_TOOLS_URL : $(TESTBED_TOOLS_URL)
displayName : KVM dump
2022-10-19 00:33:17 -05:00
- script : |
2023-07-09 21:49:22 -05:00
set -e
2022-10-19 00:33:17 -05:00
echo "Try to cancel test plan $TEST_PLAN_ID, cancelling finished test plan has no effect."
python ./.azure-pipelines/test_plan.py cancel -i "$(TEST_PLAN_ID)"
condition : always()
env :
TESTBED_TOOLS_URL : $(TESTBED_TOOLS_URL)
TENANT_ID : $(TESTBED_TOOLS_MSAL_TENANT_ID)
CLIENT_ID : $(TESTBED_TOOLS_MSAL_CLIENT_ID)
CLIENT_SECRET : $(TESTBED_TOOLS_MSAL_CLIENT_SECRET)
displayName : Finalize running test plan