Skip to content

Commit acacda0

Browse files
authored
Run 20 vs tests at a time. (sonic-net#1111)
In vs test, run 20 tests at a time instead of running all the tests together. This may help in fixing the test issue.
1 parent 91190df commit acacda0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

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

+16-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,22 @@ jobs:
6464
docker ps
6565
ip netns list
6666
pushd sonic-swss/tests
67-
sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
67+
all_tests=$(ls test_*.py)
68+
all_tests="${all_tests} p4rt"
69+
test_set=()
70+
# Run 20 tests as a set.
71+
for test in ${all_tests}; do
72+
test_set+=("${test}")
73+
if [ ${#test_set[@]} -ge 20 ]; then
74+
test_name=$(echo "${test_set[0]}" | cut -d "." -f 1)
75+
echo "${test_set[*]}" | xargs sudo py.test -v --force-flaky --junitxml="${test_name}_tr.xml" --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
76+
test_set=()
77+
fi
78+
done
79+
if [ ${#test_set[@]} -gt 0 ]; then
80+
test_name=$(echo "${test_set[0]}" | cut -d "." -f 1)
81+
echo "${test_set[*]}" | xargs sudo py.test -v --force-flaky --junitxml="${test_name}_tr.xml" --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber)
82+
fi
6883
rm -rf $(Build.ArtifactStagingDirectory)/download
6984
displayName: "Run vs tests"
7085

0 commit comments

Comments
 (0)