From e47bb9c1d07dc67d0a3609a494a91c32ecbe6d85 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Fri, 24 Feb 2017 17:46:38 -0500 Subject: [PATCH] run-tests.sh exit non-zero if gofmt fails No issue # --- build/run-tests.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/run-tests.sh b/build/run-tests.sh index d9229859ed..44f9a303e7 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -548,14 +548,14 @@ do_test_once() { # before trying "go test". Otherwise, coverage-reporting # 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]}" ]] + go get -t "git.curoverse.com/arvados.git/$1" && \ + cd "$WORKSPACE/$1" && \ + [[ -z "$(gofmt -e -d . | tee /dev/stderr)" ]] && \ + if [[ -n "${testargs[$1]}" ]] then # "go test -check.vv giturl" doesn't work, but this # does: - cd "$WORKSPACE/$1" && go test ${short:+-short} ${testargs[$1]} + go test ${short:+-short} ${testargs[$1]} else # The above form gets verbose even when testargs is # empty, so use this form in such cases: -- 2.30.2