Skip to content

Commit

Permalink
Run 20 vs tests at a time. (#1111)
Browse files Browse the repository at this point in the history
In vs test, run 20 tests at a time instead of running all the tests together.
This may help in fixing the test issue.
  • Loading branch information
mint570 authored Aug 29, 2022
1 parent ffc4109 commit da26ace
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .azure-pipelines/test-docker-sonic-vs-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,22 @@ jobs:
docker ps
ip netns list
pushd sonic-swss/tests
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
all_tests=$(ls test_*.py)
all_tests="${all_tests} p4rt"
test_set=()
# Run 20 tests as a set.
for test in ${all_tests}; do
test_set+=("${test}")
if [ ${#test_set[@]} -ge 20 ]; then
test_name=$(echo "${test_set[0]}" | cut -d "." -f 1)
echo "${test_set[*]}" | xargs sudo py.test -v --force-flaky --junitxml="${test_name}_tr.xml" --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
test_set=()
fi
done
if [ ${#test_set[@]} -gt 0 ]; then
test_name=$(echo "${test_set[0]}" | cut -d "." -f 1)
echo "${test_set[*]}" | xargs sudo py.test -v --force-flaky --junitxml="${test_name}_tr.xml" --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
fi
rm -rf $(Build.ArtifactStagingDirectory)/download
displayName: "Run vs tests"
Expand Down

0 comments on commit da26ace

Please sign in to comment.