X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/92d7a504629d848927d5334b0a801cd3993a585b..37f07a3f9f202f66a88eb70dcd0002713889a9b0:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index de64b8cc5b..2e8641a5f3 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -26,6 +26,7 @@ Options: You should provide GOPATH, GEMHOME, and VENVDIR options from a previous invocation if you use this option. --only-install Run specific install step +--short Skip (or scale down) some slow tests. WORKSPACE=path Arvados source tree to test. CONFIGSRC=path Dir with api server config files to copy into source tree. (If none given, leave config files alone in source tree.) @@ -69,6 +70,7 @@ services/fuse services/keep-web services/keepproxy services/keepstore +services/keep-balance services/login-sync services/nodemanager services/crunch-run @@ -78,8 +80,10 @@ sdk/cli sdk/pam sdk/python sdk/ruby +sdk/go/arvados sdk/go/arvadosclient sdk/go/keepclient +sdk/go/httpserver sdk/go/manifest sdk/go/blockdigest sdk/go/streamer @@ -87,6 +91,7 @@ sdk/go/crunchrunner sdk/cwl tools/crunchstat-summary tools/keep-rsync +tools/keep-block-check EOF @@ -104,6 +109,7 @@ PYTHONPATH= GEMHOME= PERLINSTALLBASE= +short= skip_install= temp= temp_preserve= @@ -146,6 +152,8 @@ sanity_checks() { echo -n 'go: ' go version \ || fatal "No go binary. See http://golang.org/doc/install" + [[ $(go version) =~ go1.([0-9]+) ]] && [[ ${BASH_REMATCH[1]} -ge 6 ]] \ + || fatal "Go >= 1.6 required. See http://golang.org/doc/install" echo -n 'gcc: ' gcc --version | egrep ^gcc \ || fatal "No gcc. Try: apt-get install build-essential" @@ -202,6 +210,9 @@ do --only) only="$1"; skip[$1]=""; shift ;; + --short) + short=1 + ;; --skip-install) skip_install=1 ;; @@ -487,28 +498,29 @@ 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 if [[ -n "${testargs[$1]}" ]] then # "go test -check.vv giturl" doesn't work, but this # does: - cd "$WORKSPACE/$1" && \ - go get -t "git.curoverse.com/arvados.git/$1" && \ - go test ${coverflags[@]} ${testargs[$1]} + cd "$WORKSPACE/$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: - go get -t "git.curoverse.com/arvados.git/$1" && \ - go test ${coverflags[@]} "git.curoverse.com/arvados.git/$1" + go test ${short:+-short} ${coverflags[@]} "git.curoverse.com/arvados.git/$1" fi result="$?" - go tool cover -html="$WORKSPACE/tmp/.$covername.tmp" -o "$WORKSPACE/tmp/$covername.html" - rm "$WORKSPACE/tmp/.$covername.tmp" + if [[ -f "$WORKSPACE/tmp/.$covername.tmp" ]] + then + go tool cover -html="$WORKSPACE/tmp/.$covername.tmp" -o "$WORKSPACE/tmp/$covername.html" + rm "$WORKSPACE/tmp/.$covername.tmp" + 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 test ${testargs[$1]} + && "${3}python" setup.py ${short:+--short-tests-only} test ${testargs[$1]} elif [[ "$2" != "" ]] then "test_$2" @@ -695,16 +707,20 @@ do_install services/api apiserver declare -a gostuff gostuff=( + sdk/go/arvados sdk/go/arvadosclient sdk/go/blockdigest + sdk/go/httpserver sdk/go/manifest sdk/go/streamer sdk/go/crunchrunner + lib/crunchstat services/arv-git-httpd services/crunchstat services/keep-web services/keepstore sdk/go/keepclient + services/keep-balance services/keepproxy services/datamanager/summary services/datamanager/collection @@ -714,6 +730,7 @@ gostuff=( services/crunch-dispatch-slurm services/crunch-run tools/keep-rsync + tools/keep-block-check ) for g in "${gostuff[@]}" do @@ -744,7 +761,7 @@ stop_services test_apiserver() { rm -f "$WORKSPACE/services/api/git-commit.version" cd "$WORKSPACE/services/api" \ - && RAILS_ENV=test bundle exec rake test TESTOPTS=-v ${testargs[services/api]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test TESTOPTS=-v ${testargs[services/api]} } do_test services/api apiserver @@ -790,21 +807,21 @@ done test_workbench() { start_nginx_proxy_services \ && cd "$WORKSPACE/apps/workbench" \ - && RAILS_ENV=test bundle exec rake test TESTOPTS=-v ${testargs[apps/workbench]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test TESTOPTS=-v ${testargs[apps/workbench]} } do_test apps/workbench workbench test_workbench_benchmark() { start_nginx_proxy_services \ && cd "$WORKSPACE/apps/workbench" \ - && RAILS_ENV=test bundle exec rake test:benchmark ${testargs[apps/workbench_benchmark]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:benchmark ${testargs[apps/workbench_benchmark]} } do_test apps/workbench_benchmark workbench_benchmark test_workbench_profile() { start_nginx_proxy_services \ && cd "$WORKSPACE/apps/workbench" \ - && RAILS_ENV=test bundle exec rake test:profile ${testargs[apps/workbench_profile]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:profile ${testargs[apps/workbench_profile]} } do_test apps/workbench_profile workbench_profile