Why I did it
Introduce 2 sub jobs for kvmtest t0 job in sonic-mgmt repo in PR Azure/sonic-mgmt#4861
But in sonic-buildimage repo, because section parameter is null, it always run the part 2 test scripts in kvmtest t0 job.
It missed the part 1 test scripts in kvmtest.sh.
How I did it
Split kvmtest t0 job into two sub jobs such as sonic-mgmt repo and run them in parallel to save time.
How to verify it
Submit PR will trigger the pipeline to run.
Signed-off-by: Zhaohui Sun <zhaohuisun@microsoft.com>
(cherry picked from commit 44028723ef
)
Co-authored-by: Zhaohui Sun <94606222+ZhaohuiS@users.noreply.github.com>
This commit is contained in:
parent
5d2ae332d4
commit
3289598ea4
@ -7,6 +7,9 @@ parameters:
|
||||
type: string
|
||||
- name: ptf_name
|
||||
type: string
|
||||
- name: section
|
||||
type: string
|
||||
default: ''
|
||||
|
||||
steps:
|
||||
- checkout: self
|
||||
@ -36,7 +39,7 @@ steps:
|
||||
|
||||
- script: |
|
||||
rm -rf $(Build.ArtifactStagingDirectory)/*
|
||||
docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }}"
|
||||
docker exec sonic-mgmt bash -c "/data/sonic-mgmt/tests/kvmtest.sh -en -T ${{ parameters.tbtype }} ${{ parameters.tbname }} ${{ parameters.dut }} ${{ parameters.section }}"
|
||||
displayName: "Run tests"
|
||||
|
||||
- script: |
|
||||
@ -68,17 +71,17 @@ steps:
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/kvmdump
|
||||
artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype}}.memdump@$(System.JobAttempt)
|
||||
artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype}}${{ parameters.section }}.memdump@$(System.JobAttempt)
|
||||
displayName: "Archive sonic kvm memdump"
|
||||
condition: failed()
|
||||
|
||||
- publish: $(Build.ArtifactStagingDirectory)/logs
|
||||
artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype }}.log@$(System.JobAttempt)
|
||||
artifact: sonic-buildimage.kvmtest.${{ parameters.tbtype }}${{ parameters.section }}.log@$(System.JobAttempt)
|
||||
displayName: "Archive sonic kvm logs"
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFiles: '$(Build.ArtifactStagingDirectory)/logs/**/*.xml'
|
||||
testRunTitle: kvmtest.${{ parameters.tbtype }}
|
||||
testRunTitle: kvmtest.${{ parameters.tbtype }}${{ parameters.section }}
|
||||
condition: succeededOrFailed()
|
||||
|
@ -119,9 +119,9 @@ stages:
|
||||
testResultsFiles: '**/tr.xml'
|
||||
testRunTitle: vstest
|
||||
|
||||
- job:
|
||||
- job: t0_part1
|
||||
pool: sonictest
|
||||
displayName: "kvmtest-t0"
|
||||
displayName: "kvmtest-t0-part1"
|
||||
timeoutInMinutes: 300
|
||||
|
||||
steps:
|
||||
@ -131,6 +131,43 @@ stages:
|
||||
tbname: vms-kvm-t0
|
||||
ptf_name: ptf_vms6-1
|
||||
tbtype: t0
|
||||
section: part-1
|
||||
|
||||
- job: t0_part2
|
||||
pool: sonictest
|
||||
displayName: "kvmtest-t0-part2"
|
||||
timeoutInMinutes: 300
|
||||
|
||||
steps:
|
||||
- template: .azure-pipelines/run-test-template.yml
|
||||
parameters:
|
||||
dut: vlab-01
|
||||
tbname: vms-kvm-t0
|
||||
ptf_name: ptf_vms6-1
|
||||
tbtype: t0
|
||||
section: part-2
|
||||
|
||||
- job:
|
||||
pool: sonictest
|
||||
displayName: "kvmtest-t0"
|
||||
timeoutInMinutes: 300
|
||||
dependsOn:
|
||||
- t0_part1
|
||||
- t0_part2
|
||||
condition: always()
|
||||
variables:
|
||||
resultOfPart1: $[ dependencies.t0_part1.result ]
|
||||
resultOfPart2: $[ dependencies.t0_part2.result ]
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
if [ $(resultOfPart1) == "Succeeded" ] && [ $(resultOfPart2) == "Succeeded" ]; then
|
||||
echo "Both job kvmtest-t0-part1 and kvmtest-t0-part2 are passed."
|
||||
exit 0
|
||||
else
|
||||
echo "Either job kvmtest-t0-part1 or job kvmtest-t0-part2 failed! Please check the detailed information."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- job:
|
||||
pool: sonictest-t1-lag
|
||||
|
Reference in New Issue
Block a user