X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e63f502086fa0cfd1570b3bb02416abba9186307..0821f5481edd016a3744bb50d97a9e5b99cd1a0f:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index c9cb2b2199..2797ec3109 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -520,6 +520,8 @@ do_test_once() { # mode makes Go show the wrong line numbers when reporting # compilation errors. go get -t "git.curoverse.com/arvados.git/$1" || return 1 + cd "$WORKSPACE/$1" || return 1 + gofmt -e -d . | egrep . && result=1 if [[ -n "${testargs[$1]}" ]] then # "go test -check.vv giturl" doesn't work, but this @@ -530,7 +532,7 @@ do_test_once() { # empty, so use this form in such cases: go test ${short:+-short} ${coverflags[@]} "git.curoverse.com/arvados.git/$1" fi - result="$?" + result=${result:-$?} if [[ -f "$WORKSPACE/tmp/.$covername.tmp" ]] then go tool cover -html="$WORKSPACE/tmp/.$covername.tmp" -o "$WORKSPACE/tmp/$covername.html" @@ -538,10 +540,22 @@ do_test_once() { fi elif [[ "$2" == "pip" ]] then - # $3 can name a path directory for us to use, including trailing - # slash; e.g., the bin/ subdirectory of a virtualenv. - cd "$WORKSPACE/$1" \ - && "${3}python" setup.py ${short:+--short-tests-only} test ${testargs[$1]} + tries=0 + cd "$WORKSPACE/$1" && while : + do + tries=$((${tries}+1)) + # $3 can name a path directory for us to use, including trailing + # slash; e.g., the bin/ subdirectory of a virtualenv. + "${3}python" setup.py ${short:+--short-tests-only} test ${testargs[$1]} + result=$? + if [[ ${tries} < 3 && ${result} == 137 ]] + then + printf '\n*****\n%s tests killed -- retrying\n*****\n\n' "$1" + continue + else + break + fi + done elif [[ "$2" != "" ]] then "test_$2"