Merge branch '8784-dir-listings'
[arvados.git] / build / run-tests.sh
index 87a7264e9b27cb189e280ef1da5be606aa582b89..00987a8efab0f7bc81da391beb4c661e69db4813 100755 (executable)
@@ -1,6 +1,9 @@
 #!/bin/bash
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
 
-. `dirname "$(readlink -f "$0")"`/libcloud-pin
+. `dirname "$(readlink -f "$0")"`/libcloud-pin.sh
 
 COLUMNS=80
 . `dirname "$(readlink -f "$0")"`/run-library.sh
@@ -78,6 +81,7 @@ services/keepstore
 services/keep-balance
 services/login-sync
 services/nodemanager
+services/nodemanager-integration
 services/crunch-run
 services/crunch-dispatch-local
 services/crunch-dispatch-slurm
@@ -165,14 +169,11 @@ sanity_checks() {
     echo -n 'ruby: '
     ruby -v \
         || fatal "No ruby. Install >=2.1.9 (using rbenv, rvm, or source)"
-    echo -n 'bundler: '
-    bundle version \
-        || fatal "No bundler. Try: gem install bundler"
     echo -n 'go: '
     go version \
         || fatal "No go binary. See http://golang.org/doc/install"
-    [[ $(go version) =~ go1.([0-9]+) ]] && [[ ${BASH_REMATCH[1]} -ge 7 ]] \
-        || fatal "Go >= 1.7 required. See http://golang.org/doc/install"
+    [[ $(go version) =~ go1.([0-9]+) ]] && [[ ${BASH_REMATCH[1]} -ge 8 ]] \
+        || fatal "Go >= 1.8 required. See http://golang.org/doc/install"
     echo -n 'gcc: '
     gcc --version | egrep ^gcc \
         || fatal "No gcc. Try: apt-get install build-essential"
@@ -348,13 +349,13 @@ done
 
 setup_ruby_environment() {
     if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
-      source "$HOME/.rvm/scripts/rvm"
-      using_rvm=true
+        source "$HOME/.rvm/scripts/rvm"
+        using_rvm=true
     elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
-      source "/usr/local/rvm/scripts/rvm"
-      using_rvm=true
+        source "/usr/local/rvm/scripts/rvm"
+        using_rvm=true
     else
-      using_rvm=false
+        using_rvm=false
     fi
 
     if [[ "$using_rvm" == true ]]; then
@@ -403,12 +404,14 @@ setup_ruby_environment() {
 
         tmpdir_gem_home="$(env - PATH="$PATH" HOME="$GEMHOME" gem env gempath | cut -f1 -d:)"
         PATH="$tmpdir_gem_home/bin:$PATH"
-        export GEM_PATH="$tmpdir_gem_home:$(gem env gempath)"
+        export GEM_PATH="$tmpdir_gem_home"
 
         echo "Will install dependencies to $(gem env gemdir)"
         echo "Will install arvados gems to $tmpdir_gem_home"
         echo "Gem search path is GEM_PATH=$GEM_PATH"
     fi
+    bundle config || gem install bundler \
+        || fatal 'install bundler'
 }
 
 with_test_gemset() {
@@ -447,6 +450,8 @@ export GOPATH
 mkdir -p "$GOPATH/src/git.curoverse.com"
 ln -sfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
     || fatal "symlink failed"
+go get -v github.com/kardianos/govendor \
+    || fatal "govendor install failed"
 
 setup_virtualenv "$VENVDIR" --python python2.7
 . "$VENVDIR/bin/activate"
@@ -566,7 +571,7 @@ do_test_once() {
         # mode makes Go show the wrong line numbers when reporting
         # compilation errors.
         go get -t "git.curoverse.com/arvados.git/$1" && \
-            cd "$WORKSPACE/$1" && \
+            cd "$GOPATH/src/git.curoverse.com/arvados.git/$1" && \
             [[ -z "$(gofmt -e -d . | tee /dev/stderr)" ]] && \
             if [[ -n "${testargs[$1]}" ]]
         then
@@ -760,6 +765,9 @@ install_apiserver() {
 }
 do_install services/api apiserver
 
+cd "$GOPATH/src/git.curoverse.com/arvados.git" && \
+    "$GOPATH/bin/govendor" sync -v || \
+        fatal "govendor sync failed"
 declare -a gostuff
 gostuff=(
     sdk/go/arvados
@@ -786,7 +794,7 @@ gostuff=(
     tools/keep-block-check
     tools/keep-exercise
     tools/keep-rsync
-    )
+)
 for g in "${gostuff[@]}"
 do
     do_install "$g" go
@@ -850,6 +858,12 @@ test_login-sync() {
 }
 do_test services/login-sync login-sync
 
+test_nodemanager-integration() {
+    cd "$WORKSPACE/services/nodemanager" \
+        && tests/integration_test.py ${testargs[services/nodemanager-integration]}
+}
+do_test services/nodemanager-integration nodemanager-integration
+
 for p in "${pythonstuff[@]}"
 do
     dir=${p%:py3}