Skip to content

Commit 305a3e4

Browse files
authored
[ci]: use the same snapshot of pytests as the docker-sonic-vs image (sonic-net#1545)
in case sonic-swss build failure, the docker-sonic-vs may not match exactly the same pytest checkout from master Signed-off-by: Guohan Lu <[email protected]>
1 parent 3f2a296 commit 305a3e4

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.azure-pipelines/test-docker-sonic-vs-template.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,22 @@ jobs:
3030
runBranch: 'refs/heads/master'
3131
displayName: "Download sonic swss common deb packages"
3232

33+
- task: DownloadPipelineArtifact@2
34+
inputs:
35+
source: specific
36+
project: build
37+
pipeline: 15
38+
artifact: sonic-swss-pytests
39+
runVersion: 'latestFromBranch'
40+
runBranch: 'refs/heads/master'
41+
displayName: "Download sonic swss pytests"
42+
3343
- checkout: self
34-
displayName: "Checkout sonic-swss-common"
35-
- checkout: sonic-swss
36-
displayName: "Checkout sonic-swss"
44+
displayName: "Checkout sonic-utilities"
3745

3846
- script: |
3947
set -x
40-
sudo sonic-utilities/.azure-pipelines/build_and_install_module.sh
48+
sudo .azure-pipelines/build_and_install_module.sh
4149
4250
sudo apt-get install -y libhiredis0.14
4351
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb || apt-get install -f
@@ -54,7 +62,11 @@ jobs:
5462
sudo docker load -i ../docker-sonic-vs.gz
5563
docker ps
5664
ip netns list
57-
pushd sonic-swss/tests
65+
cd ../
66+
mkdir -p sonic-swss
67+
pushd sonic-swss
68+
tar xf ../pytest.tgz
69+
pushd tests
5870
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
5971
displayName: "Run vs tests"
6072
@@ -65,7 +77,7 @@ jobs:
6577
condition: always()
6678

6779
- script: |
68-
cp -r sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
80+
cp -r ../sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
6981
displayName: "Collect logs"
7082
condition: always()
7183

0 commit comments

Comments
 (0)