Skip to content

Commit

Permalink
[ci]: use the same snapshot of pytests as the docker-sonic-vs image (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
lguohan authored Apr 6, 2021
1 parent 3f2a296 commit 305a3e4
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,22 @@ jobs:
runBranch: 'refs/heads/master'
displayName: "Download sonic swss common deb packages"

- task: DownloadPipelineArtifact@2
inputs:
source: specific
project: build
pipeline: 15
artifact: sonic-swss-pytests
runVersion: 'latestFromBranch'
runBranch: 'refs/heads/master'
displayName: "Download sonic swss pytests"

- checkout: self
displayName: "Checkout sonic-swss-common"
- checkout: sonic-swss
displayName: "Checkout sonic-swss"
displayName: "Checkout sonic-utilities"

- script: |
set -x
sudo sonic-utilities/.azure-pipelines/build_and_install_module.sh
sudo .azure-pipelines/build_and_install_module.sh
sudo apt-get install -y libhiredis0.14
sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb || apt-get install -f
Expand All @@ -54,7 +62,11 @@ jobs:
sudo docker load -i ../docker-sonic-vs.gz
docker ps
ip netns list
pushd sonic-swss/tests
cd ../
mkdir -p sonic-swss
pushd sonic-swss
tar xf ../pytest.tgz
pushd tests
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
displayName: "Run vs tests"
Expand All @@ -65,7 +77,7 @@ jobs:
condition: always()

- script: |
cp -r sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
cp -r ../sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/
displayName: "Collect logs"
condition: always()
Expand Down

0 comments on commit 305a3e4

Please sign in to comment.