X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0df5f0feeced5bff0adfb806dae2d3811257827f..d56b21609ddd2e2e096f5c30e991d24aa213f7f4:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index 15ad4eae85..1dcb2d9906 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -105,6 +105,7 @@ services/crunch-dispatch-slurm services/ws sdk/cli sdk/pam +sdk/pam:py3 sdk/python sdk/python:py3 sdk/ruby @@ -380,6 +381,20 @@ checkpidfile() { echo "${svc} pid ${pid} ok" } +checkhealth() { + svc="$1" + port="$(cat "$WORKSPACE/tmp/${svc}.port")" + scheme=http + if [[ ${svc} =~ -ssl$ || ${svc} = wss ]]; then + scheme=https + fi + url="$scheme://localhost:${port}/_health/ping" + if ! curl -Ss -H "Authorization: Bearer e687950a23c3a9bceec28c6223a06c79" "${url}" | tee -a /dev/stderr | grep '"OK"'; then + echo "${url} failed" + return 1 + fi +} + checkdiscoverydoc() { dd="https://${1}/discovery/v1/apis/arvados/v1/rest" if ! (set -o pipefail; curl -fsk "$dd" | grep -q ^{ ); then @@ -395,7 +410,7 @@ start_services() { return 0 fi . "$VENVDIR/bin/activate" - echo 'Starting API, keepproxy, keep-web, ws, arv-git-httpd, and nginx ssl proxy...' + echo 'Starting API, controller, keepproxy, keep-web, arv-git-httpd, ws, and nginx ssl proxy...' if [[ ! -d "$WORKSPACE/services/api/log" ]]; then mkdir -p "$WORKSPACE/services/api/log" fi @@ -413,12 +428,15 @@ start_services() { && checkdiscoverydoc $ARVADOS_API_HOST \ && python sdk/python/tests/run_test_server.py start_controller \ && checkpidfile controller \ + && checkhealth controller \ && python sdk/python/tests/run_test_server.py start_keep_proxy \ && checkpidfile keepproxy \ && python sdk/python/tests/run_test_server.py start_keep-web \ && checkpidfile keep-web \ + && checkhealth keep-web \ && python sdk/python/tests/run_test_server.py start_arv-git-httpd \ && checkpidfile arv-git-httpd \ + && checkhealth arv-git-httpd \ && python sdk/python/tests/run_test_server.py start_ws \ && checkpidfile ws \ && eval $(python sdk/python/tests/run_test_server.py start_nginx) \ @@ -750,6 +768,7 @@ do_test_once() { title "test $1" timer_reset + result= if which deactivate >/dev/null; then deactivate; fi if ! . "$VENVDIR/bin/activate" then @@ -822,6 +841,7 @@ do_install_once() { title "install $1" timer_reset + result= if which deactivate >/dev/null; then deactivate; fi if [[ "$1" != "env" ]] && ! . "$VENVDIR/bin/activate"; then result=1 @@ -956,6 +976,7 @@ install_services/api() { || return 1 cd "$WORKSPACE/services/api" \ + && RAILS_ENV=test bundle exec rails db:environment:set \ && RAILS_ENV=test bundle exec rake db:drop \ && RAILS_ENV=test bundle exec rake db:setup \ && RAILS_ENV=test bundle exec rake db:fixtures:load @@ -972,6 +993,7 @@ pythonstuff=( services/fuse services/nodemanager tools/crunchstat-summary + tools/crunchstat-summary:py3 ) declare -a gostuff @@ -985,6 +1007,7 @@ gostuff=( lib/cloud lib/cloud/azure lib/cloud/ec2 + lib/config lib/dispatchcloud lib/dispatchcloud/container lib/dispatchcloud/scheduler @@ -1047,7 +1070,7 @@ test_gofmt() { test_services/api() { rm -f "$WORKSPACE/services/api/git-commit.version" cd "$WORKSPACE/services/api" \ - && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test TESTOPTS=-v ${testargs[services/api]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test TESTOPTS='-v -d' ${testargs[services/api]} } test_sdk/ruby() { @@ -1069,7 +1092,7 @@ test_sdk/cli() { } test_sdk/java-v2() { - cd "$WORKSPACE/sdk/java-v2" && ./gradlew test + cd "$WORKSPACE/sdk/java-v2" && gradle test } test_services/login-sync() { @@ -1084,17 +1107,17 @@ test_services/nodemanager_integration() { test_apps/workbench_units() { cd "$WORKSPACE/apps/workbench" \ - && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:units TESTOPTS=-v ${testargs[apps/workbench]} ${testargs[apps/workbench_units]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:units TESTOPTS='-v -d' ${testargs[apps/workbench]} ${testargs[apps/workbench_units]} } test_apps/workbench_functionals() { cd "$WORKSPACE/apps/workbench" \ - && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:functionals TESTOPTS=-v ${testargs[apps/workbench]} ${testargs[apps/workbench_functionals]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:functionals TESTOPTS='-v -d' ${testargs[apps/workbench]} ${testargs[apps/workbench_functionals]} } test_apps/workbench_integration() { cd "$WORKSPACE/apps/workbench" \ - && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:integration TESTOPTS=-v ${testargs[apps/workbench]} ${testargs[apps/workbench_integration]} + && env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} bundle exec rake test:integration TESTOPTS='-v -d' ${testargs[apps/workbench]} ${testargs[apps/workbench_integration]} } test_apps/workbench_benchmark() {