X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2266cd0b5066ef366c5ee76b5818b9aea344f9ae..3a126e4c7e3ab4235a8d5f84f5addebb4691ac7a:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index d8ae7c3c94..edf9f3ab23 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -77,6 +77,10 @@ doc lib/cli lib/cmd lib/controller +lib/controller/federation +lib/controller/railsproxy +lib/controller/router +lib/controller/rpc lib/crunchstat lib/cloud lib/cloud/azure @@ -105,6 +109,7 @@ services/crunch-dispatch-slurm services/ws sdk/cli sdk/pam +sdk/pam:py3 sdk/python sdk/python:py3 sdk/ruby @@ -139,6 +144,8 @@ EOF # environment that could interfere with the tests. unset $(env | cut -d= -f1 | grep \^ARVADOS_) +export ARVADOS_EXPERIMENTAL=14287 + # Reset other variables that could affect our [tests'] behavior by # accident. GITDIR= @@ -380,6 +387,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 @@ -413,12 +434,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) \ @@ -886,7 +910,7 @@ install_gem() { && cd "$WORKSPACE/$srcpath" \ && bundle_install_trylocal \ && gem build "$gemname.gemspec" \ - && with_test_gemset gem install --no-ri --no-rdoc $(ls -t "$gemname"-*.gem|head -n1) + && with_test_gemset gem install --no-document $(ls -t "$gemname"-*.gem|head -n1) } install_sdk/ruby() { @@ -979,50 +1003,7 @@ pythonstuff=( ) declare -a gostuff -gostuff=( - cmd/arvados-client - cmd/arvados-server - lib/cli - lib/cmd - lib/controller - lib/crunchstat - lib/cloud - lib/cloud/azure - lib/cloud/ec2 - lib/dispatchcloud - lib/dispatchcloud/container - lib/dispatchcloud/scheduler - lib/dispatchcloud/ssh_executor - lib/dispatchcloud/worker - lib/service - sdk/go/arvados - sdk/go/arvadosclient - sdk/go/auth - sdk/go/blockdigest - sdk/go/dispatch - sdk/go/health - sdk/go/httpserver - sdk/go/manifest - sdk/go/asyncbuf - sdk/go/crunchrunner - sdk/go/stats - services/arv-git-httpd - services/crunchstat - services/health - services/keep-web - services/keepstore - sdk/go/keepclient - services/keep-balance - services/keepproxy - services/crunch-dispatch-local - services/crunch-dispatch-slurm - services/crunch-run - services/ws - tools/keep-block-check - tools/keep-exercise - tools/keep-rsync - tools/sync-groups -) +gostuff=($(git grep -lw func | grep \\.go | sed -e 's/\/[^\/]*$//' | sort -u)) install_apps/workbench() { cd "$WORKSPACE/apps/workbench" \ @@ -1051,7 +1032,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() { @@ -1088,17 +1069,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() { @@ -1227,6 +1208,8 @@ for p in "${pythonstuff[@]}"; do testfuncargs[$dir:py3]="$dir pip $VENV3DIR/bin/" done +testfuncargs["sdk/cli"]="sdk/cli" + if [[ -z ${interactive} ]]; then install_all test_all @@ -1240,19 +1223,21 @@ else # assume emacs, or something, is offering a history buffer # and pre-populating the command will only cause trouble nextcmd= - elif [[ "$nextcmd" != "install deps" ]]; then - : - elif [[ -e "$VENVDIR/bin/activate" ]]; then - nextcmd="test lib/cmd" - else + elif [[ ! -e "$VENVDIR/bin/activate" ]]; then nextcmd="install deps" + else + nextcmd="" fi } echo help_interactive nextcmd="install deps" setnextcmd - while read -p 'What next? ' -e -i "${nextcmd}" nextcmd; do + HISTFILE="$WORKSPACE/tmp/.history" + history -r + while read -p 'What next? ' -e -i "$nextcmd" nextcmd; do + history -s "$nextcmd" + history -w read verb target opts <<<"${nextcmd}" target="${target%/}" target="${target/\/:/:}"