Skip to content

Commit

Permalink
test: Split up long tests into multiple sub tests
Browse files Browse the repository at this point in the history
Hopefully this avoids the timeouts running the lang package.
  • Loading branch information
purpleidea committed Jul 17, 2019
1 parent 0119abd commit 591e6b6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/test-gotest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,16 @@ else
for pkg in `go list -e ./... | grep -v "^${base}/vendor/" | grep -v "^${base}/examples/" | grep -v "^${base}/test/" | grep -v "^${base}/old" | grep -v "^${base}/old/" | grep -v "^${base}/tmp" | grep -v "^${base}/tmp/" | grep -v "^${base}/integration"`; do
echo -e "\ttesting: $pkg"
if [[ "$@" = *"--race"* ]]; then
run-test go test -count=1 -race "$pkg"
# split up long tests to avoid CI timeouts
if [ "$pkg" = "${base}/lang" ]; then # pkg lang is big!
for sub in `go test "${base}/lang" -list Test`; do
if [ "$sub" = "ok" ]; then break; fi # skip go test output artifact
echo -e "\t\tsub-testing: $sub"
run-test go test -count=1 -race "$pkg" -run "$sub"
done
else
run-test go test -count=1 -race "$pkg"
fi
else
run-test go test -count=1 "$pkg"
fi
Expand Down

0 comments on commit 591e6b6

Please sign in to comment.