From 591e6b68e0ce53b4ffed439f762ca19a8405cda6 Mon Sep 17 00:00:00 2001 From: James Shubin Date: Wed, 17 Jul 2019 00:21:14 -0400 Subject: [PATCH] test: Split up long tests into multiple sub tests Hopefully this avoids the timeouts running the lang package. --- test/test-gotest.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/test-gotest.sh b/test/test-gotest.sh index bea5c3fa..5d852063 100755 --- a/test/test-gotest.sh +++ b/test/test-gotest.sh @@ -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