Tidy up error checks in govendor test.
authorTom Clegg <tclegg@veritasgenetics.com>
Tue, 18 Jun 2019 20:37:46 +0000 (16:37 -0400)
committerTom Clegg <tclegg@veritasgenetics.com>
Tue, 18 Jun 2019 20:37:46 +0000 (16:37 -0400)
No issue #

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

build/run-tests.sh

index 9ccfe926857e6a23dd432293fa621e2e4ed86b7d..97c21b405ca8ef50eec0a2f93ee6679ddb909c8f 100755 (executable)
@@ -1053,19 +1053,24 @@ test_gofmt() {
 }
 
 test_govendor() {
-    cd "$GOPATH/src/git.curoverse.com/arvados.git" || return 1
-    # Remove cached source dirs in workdir. Otherwise, they will
-    # not qualify as +missing or +external below, and we won't be
-    # able to detect that they're missing from vendor/vendor.json.
-    rm -rf vendor/*/
-    go get -v -d ...
-    "$GOPATH/bin/govendor" sync
-    [[ -z $("$GOPATH/bin/govendor" list +unused +missing +external | tee /dev/stderr) ]] \
-        || fatal "vendor/vendor.json has unused or missing dependencies -- try:
+    (
+        set -e
+        cd "$GOPATH/src/git.curoverse.com/arvados.git"
+        # Remove cached source dirs in workdir. Otherwise, they will
+        # not qualify as +missing or +external below, and we won't be
+        # able to detect that they're missing from vendor/vendor.json.
+        rm -rf vendor/*/
+        go get -v -d ...
+        "$GOPATH/bin/govendor" sync
+        if [[ -n $("$GOPATH/bin/govendor" list +unused +missing +external | tee /dev/stderr) ]]; then
+            echo >&2 "vendor/vendor.json has unused or missing dependencies -- try:
 
 (export GOPATH=\"${GOPATH}\"; cd \$GOPATH/src/git.curoverse.com/arvados.git && \$GOPATH/bin/govendor add +missing +external && \$GOPATH/bin/govendor remove +unused)
 
-";
+"
+            return 1
+        fi
+    )
 }
 
 test_services/api() {