X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ebb2559b3a09636ff687316bbe512e0e8a86b168..31d31c010bb6b5170e3962fdd50c6d393cfe6076:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index e0e1ce2852..32432f8986 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -22,6 +22,8 @@ Options: --leave-temp Do not remove GOPATH, virtualenv, and other temp dirs at exit. Instead, show the path to give as --temp to reuse them in subsequent invocations. +--repeat N Repeat each install/test step until it succeeds N times. +--retry Prompt to retry if an install or test suite fails. --skip-install Do not run any install steps. Just run tests. You should provide GOPATH, GEMHOME, and VENVDIR options from a previous invocation if you use this option. @@ -83,9 +85,11 @@ services/ws sdk/cli sdk/pam sdk/python +sdk/python:py3 sdk/ruby sdk/go/arvados sdk/go/arvadosclient +sdk/go/dispatch sdk/go/keepclient sdk/go/httpserver sdk/go/manifest @@ -119,7 +123,7 @@ GEMHOME= PERLINSTALLBASE= short= -skip_install= +only_install= temp= temp_preserve= @@ -173,11 +177,17 @@ sanity_checks() { gcc --version | egrep ^gcc \ || fatal "No gcc. Try: apt-get install build-essential" echo -n 'fuse.h: ' - find /usr/include -wholename '*fuse/fuse.h' \ + find /usr/include -path '*fuse/fuse.h' | egrep --max-count=1 . \ || fatal "No fuse/fuse.h. Try: apt-get install libfuse-dev" - echo -n 'pyconfig.h: ' - find /usr/include -name pyconfig.h | egrep --max-count=1 . \ - || fatal "No pyconfig.h. Try: apt-get install python-dev" + echo -n 'gnutls.h: ' + find /usr/include -path '*gnutls/gnutls.h' | egrep --max-count=1 . \ + || fatal "No gnutls/gnutls.h. Try: apt-get install libgnutls28-dev" + echo -n 'Python2 pyconfig.h: ' + find /usr/include -path '*/python2*/pyconfig.h' | egrep --max-count=1 . \ + || fatal "No Python2 pyconfig.h. Try: apt-get install python2.7-dev" + echo -n 'Python3 pyconfig.h: ' + find /usr/include -path '*/python3*/pyconfig.h' | egrep --max-count=1 . \ + || fatal "No Python3 pyconfig.h. Try: apt-get install python3-dev" echo -n 'nginx: ' PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" nginx -v \ || fatal "No nginx. Try: apt-get install nginx" @@ -219,14 +229,7 @@ do exit 1 ;; --skip) - skipwhat="$1"; shift - if [[ "$skipwhat" == "apps/workbench" ]]; then - skip["apps/workbench_units"]=1 - skip["apps/workbench_functionals"]=1 - skip["apps/workbench_integration"]=1 - else - skip[$skipwhat]=1 - fi + skip[$1]=1; shift ;; --only) only="$1"; skip[$1]=""; shift @@ -235,10 +238,9 @@ do short=1 ;; --skip-install) - skip_install=1 + only_install=nothing ;; --only-install) - skip_install=1 only_install="$1"; shift ;; --temp) @@ -248,6 +250,9 @@ do --leave-temp) temp_preserve=1 ;; + --repeat) + repeat=$((${1}+0)); shift + ;; --retry) retry=1 ;; @@ -440,7 +445,7 @@ export PERLLIB="$PERLINSTALLBASE/lib/perl5:${PERLLIB:+$PERLLIB}" export GOPATH mkdir -p "$GOPATH/src/git.curoverse.com" -ln -sfn "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \ +ln -sfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \ || fatal "symlink failed" setup_virtualenv "$VENVDIR" --python python2.7 @@ -457,30 +462,37 @@ pip freeze 2>/dev/null | egrep ^apache-libcloud==$LIBCLOUD_PIN \ || pip install --pre --ignore-installed https://github.com/curoverse/libcloud/archive/apache-libcloud-$LIBCLOUD_PIN.zip >/dev/null \ || fatal "pip install apache-libcloud failed" -# This will help people who reuse --temp dirs when we upgrade to llfuse 0.42 -if egrep -q 'llfuse.*>= *0\.42' "$WORKSPACE/services/fuse/setup.py"; then - # Uninstall old llfuse, because services/fuse "pip install" won't - # upgrade it by default. - if pip freeze | egrep '^llfuse==0\.41\.'; then - yes | pip uninstall 'llfuse<0.42' - fi +# Uninstall old llfuse (<1.0), because services/fuse "pip install" +# won't upgrade it by default. +if pip freeze | egrep '^llfuse==0'; then + yes | pip uninstall 'llfuse<1.0' fi # Deactivate Python 2 virtualenv deactivate +declare -a pythonstuff +pythonstuff=( + sdk/pam + sdk/python + sdk/python:py3 + sdk/cwl + services/dockercleaner:py3 + services/fuse + services/nodemanager + tools/crunchstat-summary + ) + # If Python 3 is available, set up its virtualenv in $VENV3DIR. # Otherwise, skip dependent tests. PYTHON3=$(which python3) -if [ "0" = "$?" ]; then +if [[ ${?} = 0 ]]; then setup_virtualenv "$VENV3DIR" --python python3 else PYTHON3= - skip[services/dockercleaner]=1 cat >&2 </dev/null + mkdir -p "$WORKSPACE/services/api/tmp/pids" + cd "$WORKSPACE/services/api" \ && RAILS_ENV=test bundle exec rake db:drop \ && RAILS_ENV=test bundle exec rake db:setup \ @@ -760,6 +765,7 @@ gostuff=( sdk/go/arvados sdk/go/arvadosclient sdk/go/blockdigest + sdk/go/dispatch sdk/go/httpserver sdk/go/manifest sdk/go/streamer @@ -793,6 +799,8 @@ install_workbench() { } do_install apps/workbench workbench +unset http_proxy https_proxy no_proxy + test_doclinkchecker() { ( set -e @@ -844,9 +852,17 @@ do_test services/login-sync login-sync for p in "${pythonstuff[@]}" do - do_test "$p" pip + dir=${p%:py3} + if [[ ${dir} = ${p} ]]; then + if [[ -z ${skip[python2]} ]]; then + do_test ${dir} pip + fi + elif [[ -n ${PYTHON3} ]]; then + if [[ -z ${skip[python3]} ]]; then + do_test ${dir} pip "$VENV3DIR/bin/" + fi + fi done -do_test services/dockercleaner pip "$VENV3DIR/bin/" for g in "${gostuff[@]}" do