15107: Update "go get" uses in test/package scripts.
authorTom Clegg <tclegg@veritasgenetics.com>
Thu, 14 Nov 2019 21:31:56 +0000 (16:31 -0500)
committerTom Clegg <tclegg@veritasgenetics.com>
Thu, 14 Nov 2019 21:31:56 +0000 (16:31 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>

build/run-library.sh
build/run-tests.sh

index cc491770cad08ff05d595fc147a558e8a42061a5..a4cebbc8a71d07de545a8382dd001a736802a548 100755 (executable)
@@ -111,6 +111,7 @@ calculate_go_package_version() {
   local src_path="$1"; shift
 
   cd "$WORKSPACE/$src_path"
+  go mod download
   local version="$(version_from_git)"
   local timestamp="$(timestamp_from_git)"
 
index 8cf61b9ed37790c509f1e5b888d0d6d4e100c85e..38005070c70454dc3b07045f2d0d9d7feaa35458 100755 (executable)
@@ -631,6 +631,7 @@ initialize() {
 }
 
 install_env() {
+    go mod download || fatal "Go deps failed"
     which goimports >/dev/null || go get golang.org/x/tools/cmd/goimports || fatal "Go setup failed"
 
     setup_virtualenv "$VENVDIR" --python python2.7
@@ -752,11 +753,11 @@ do_test_once() {
     then
         covername="coverage-$(echo "$1" | sed -e 's/\//_/g')"
         coverflags=("-covermode=count" "-coverprofile=$WORKSPACE/tmp/.$covername.tmp")
-        # We do "go get -t" here to catch compilation errors
+        # We do "go install" here to catch compilation errors
         # before trying "go test". Otherwise, coverage-reporting
         # mode makes Go show the wrong line numbers when reporting
         # compilation errors.
-        go get -ldflags "$(go_ldflags)" -t "git.curoverse.com/arvados.git/$1" && \
+        go install -ldflags "$(go_ldflags)" "$WORKSPACE/$1" && \
             cd "$WORKSPACE/$1" && \
             if [[ -n "${testargs[$1]}" ]]
         then
@@ -844,7 +845,7 @@ do_install_once() {
         result=1
     elif [[ "$2" == "go" ]]
     then
-        go get -ldflags "$(go_ldflags)" -t "git.curoverse.com/arvados.git/$1"
+        go install -ldflags "$(go_ldflags)" "$WORKSPACE/$1"
     elif [[ "$2" == "pip" ]]
     then
         # $3 can name a path directory for us to use, including trailing