X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/36cfafd6e7eae2784c22aefdd9df26783412d42a..a589414542d59a410c14a2241c05cd0d71bd8840:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index 4fbb4e6f04..2cd8fdd6eb 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -58,7 +58,7 @@ defaults to $HOME/arvados-api-server if that directory exists. More information and background: -https://arvados.org/projects/arvados/wiki/Running_tests +https://dev.arvados.org/projects/arvados/wiki/Running_tests Available tests: @@ -69,6 +69,7 @@ apps/workbench_integration (*) apps/workbench_benchmark apps/workbench_profile cmd/arvados-client +cmd/arvados-package cmd/arvados-server doc lib/cli @@ -93,7 +94,6 @@ lib/pam lib/service services/api services/githttpd -services/crunchstat services/dockercleaner services/fuse services/fuse:py3 @@ -105,10 +105,13 @@ services/keep-balance services/login-sync services/crunch-dispatch-local services/crunch-dispatch-slurm +services/workbench2_units +services/workbench2_integration services/ws sdk/cli sdk/python sdk/python:py3 +sdk/ruby-google-api-client sdk/ruby sdk/go/arvados sdk/go/arvadosclient @@ -149,7 +152,6 @@ VENVDIR= VENV3DIR= PYTHONPATH= GEMHOME= -PERLINSTALLBASE= R_LIBS= export LANG=en_US.UTF-8 @@ -231,14 +233,6 @@ sanity_checks() { echo -n 'nginx: ' PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin" nginx -v \ || fatal "No nginx. Try: apt-get install nginx" - echo -n 'perl: ' - perl -v | grep version \ - || fatal "No perl. Try: apt-get install perl" - for mod in ExtUtils::MakeMaker JSON LWP Net::SSL; do - echo -n "perl $mod: " - perl -e "use $mod; print \"\$$mod::VERSION\\n\"" \ - || fatal "No $mod. Try: apt-get install perl-modules libcrypt-ssleay-perl libjson-perl libwww-perl" - done echo -n 'gitolite: ' which gitolite \ || fatal "No gitolite. Try: apt-get install gitolite3" @@ -598,7 +592,7 @@ setup_virtualenv() { elif [[ -n "$short" ]]; then return fi - "$venvdest/bin/pip3" install --no-cache-dir 'setuptools>=18.5' 'pip>=7' + "$venvdest/bin/pip3" install --no-cache-dir 'setuptools>=68' 'pip>=20' } initialize() { @@ -620,7 +614,7 @@ initialize() { fi # Set up temporary install dirs (unless existing dirs were supplied) - for tmpdir in VENV3DIR GOPATH GEMHOME PERLINSTALLBASE R_LIBS + for tmpdir in VENV3DIR GOPATH GEMHOME R_LIBS do if [[ -z "${!tmpdir}" ]]; then eval "$tmpdir"="$temp/$tmpdir" @@ -632,9 +626,6 @@ initialize() { rm -vf "${WORKSPACE}/tmp/*.log" - export PERLINSTALLBASE - export PERL5LIB="$PERLINSTALLBASE/lib/perl5${PERL5LIB:+:$PERL5LIB}" - export R_LIBS export GOPATH @@ -664,22 +655,14 @@ install_env() { setup_virtualenv "$VENV3DIR" . "$VENV3DIR/bin/activate" - # Needed for run_test_server.py which is used by certain (non-Python) tests. - # pdoc3 needed to generate the Python SDK documentation. - ( - set -e - "${VENV3DIR}/bin/pip3" install wheel - "${VENV3DIR}/bin/pip3" install PyYAML - "${VENV3DIR}/bin/pip3" install httplib2 - "${VENV3DIR}/bin/pip3" install future - "${VENV3DIR}/bin/pip3" install google-api-python-client - "${VENV3DIR}/bin/pip3" install ciso8601 - "${VENV3DIR}/bin/pip3" install pycurl - "${VENV3DIR}/bin/pip3" install ws4py - "${VENV3DIR}/bin/pip3" install pdoc3 - cd "$WORKSPACE/sdk/python" - python3 setup.py install - ) || fatal "installing PyYAML and sdk/python failed" + # PyYAML is a test requirement used by run_test_server.py and needed for + # other, non-Python tests. + # pdoc is needed to build PySDK documentation. + # We run `setup.py build` first to generate _version.py. + env -C "$WORKSPACE/sdk/python" python3 setup.py build \ + && python3 -m pip install "$WORKSPACE/sdk/python" \ + && python3 -m pip install PyYAML pdoc \ + || fatal "installing Python SDK and related dependencies failed" } retry() { @@ -710,6 +693,9 @@ do_test() { apps/workbench_units | apps/workbench_functionals | apps/workbench_integration) suite=apps/workbench ;; + services/workbench2_units | services/workbench2_integration) + suite=services/workbench2 + ;; *) suite="${1}" ;; @@ -724,7 +710,21 @@ do_test() { stop_services check_arvados_config "$1" ;; - gofmt | doc | lib/cli | lib/cloud/azure | lib/cloud/ec2 | lib/cloud/cloudtest | lib/cmd | lib/dispatchcloud/sshexecutor | lib/dispatchcloud/worker) + gofmt \ + | cmd/arvados-package \ + | doc \ + | lib/boot \ + | lib/cli \ + | lib/cloud/azure \ + | lib/cloud/cloudtest \ + | lib/cloud/ec2 \ + | lib/cmd \ + | lib/dispatchcloud/sshexecutor \ + | lib/dispatchcloud/worker \ + | lib/install \ + | services/workbench2_integration \ + | services/workbench2_units \ + ) check_arvados_config "$1" # don't care whether services are running ;; @@ -742,7 +742,7 @@ do_test() { go_ldflags() { version=${ARVADOS_VERSION:-$(git log -n1 --format=%H)-dev} - echo "-X git.arvados.org/arvados.git/lib/cmd.version=${version} -X main.version=${version}" + echo "-X git.arvados.org/arvados.git/lib/cmd.version=${version} -X main.version=${version} -s -w" } do_test_once() { @@ -760,6 +760,10 @@ do_test_once() { then covername="coverage-$(echo "$1" | sed -e 's/\//_/g')" coverflags=("-covermode=count" "-coverprofile=$WORKSPACE/tmp/.$covername.tmp") + testflags=() + if [[ "$1" == "cmd/arvados-package" ]]; then + testflags+=("-timeout" "20m") + fi # We do "go install" here to catch compilation errors # before trying "go test". Otherwise, coverage-reporting # mode makes Go show the wrong line numbers when reporting @@ -770,11 +774,11 @@ do_test_once() { then # "go test -check.vv giturl" doesn't work, but this # does: - go test ${short:+-short} ${testargs[$1]} + go test ${short:+-short} ${testflags[@]} ${testargs[$1]} else # The above form gets verbose even when testargs is # empty, so use this form in such cases: - go test ${short:+-short} ${coverflags[@]} "git.arvados.org/arvados.git/$1" + go test ${short:+-short} ${testflags[@]} ${coverflags[@]} "git.arvados.org/arvados.git/$1" fi result=${result:-$?} if [[ -f "$WORKSPACE/tmp/.$covername.tmp" ]] @@ -916,6 +920,10 @@ install_sdk/ruby() { install_gem arvados sdk/ruby } +install_sdk/ruby-google-api-client() { + install_gem arvados-google-api-client sdk/ruby-google-api-client +} + install_sdk/R() { if [[ "$NEED_SDK_R" = true ]]; then cd "$WORKSPACE/sdk/R" \ @@ -923,17 +931,13 @@ install_sdk/R() { fi } -install_sdk/perl() { - cd "$WORKSPACE/sdk/perl" \ - && perl Makefile.PL INSTALL_BASE="$PERLINSTALLBASE" \ - && make install INSTALLDIRS=perl -} - install_sdk/cli() { install_gem arvados-cli sdk/cli } install_services/login-sync() { + install_gem arvados-google-api-client sdk/ruby-google-api-client + install_gem arvados sdk/ruby install_gem arvados-login-sync services/login-sync } @@ -1006,6 +1010,11 @@ install_apps/workbench() { && RAILS_ENV=test RAILS_GROUPS=assets "$bundle" exec rake npm:install } +install_services/workbench2() { + cd "$WORKSPACE/services/workbench2" \ + && make yarn-install ARVADOS_DIRECTORY="${WORKSPACE}" +} + test_doc() { ( set -e @@ -1034,6 +1043,11 @@ test_sdk/ruby() { && "$bundle" exec rake test TESTOPTS=-v ${testargs[sdk/ruby]} } +test_sdk/ruby-google-api-client() { + echo "*** note \`test sdk/ruby-google-api-client\` does not actually run any tests, see https://dev.arvados.org/issues/20993 ***" + true +} + test_sdk/R() { if [[ "$NEED_SDK_R" = true ]]; then cd "$WORKSPACE/sdk/R" \ @@ -1056,6 +1070,14 @@ test_services/login-sync() { && "$bundle" exec rake test TESTOPTS=-v ${testargs[services/login-sync]} } +test_services/workbench2_units() { + cd "$WORKSPACE/services/workbench2" && make unit-tests ARVADOS_DIRECTORY="${WORKSPACE}" WORKSPACE="$(pwd)" ${testargs[services/workbench2]} +} + +test_services/workbench2_integration() { + cd "$WORKSPACE/services/workbench2" && make integration-tests ARVADOS_DIRECTORY="${WORKSPACE}" WORKSPACE="$(pwd)" ${testargs[services/workbench2]} +} + test_apps/workbench_units() { local TASK="test:units" cd "$WORKSPACE/apps/workbench" \ @@ -1091,8 +1113,8 @@ install_deps() { do_install env do_install cmd/arvados-server go do_install sdk/cli - do_install sdk/perl do_install sdk/python pip "${VENV3DIR}/bin/" + do_install sdk/ruby-google-api-client do_install sdk/ruby do_install services/api do_install services/keepproxy go @@ -1102,9 +1124,9 @@ install_deps() { install_all() { do_install env do_install doc + do_install sdk/ruby-google-api-client do_install sdk/ruby do_install sdk/R - do_install sdk/perl do_install sdk/cli do_install services/login-sync for p in "${pythonstuff[@]}" @@ -1120,6 +1142,7 @@ install_all() { done do_install services/api do_install apps/workbench + do_install services/workbench2 } test_all() { @@ -1135,6 +1158,7 @@ test_all() { do_test gofmt do_test doc + do_test sdk/ruby-google-api-client do_test sdk/ruby do_test sdk/R do_test sdk/cli @@ -1157,6 +1181,8 @@ test_all() { do_test apps/workbench_integration do_test apps/workbench_benchmark do_test apps/workbench_profile + do_test services/workbench2_units + do_test services/workbench2_integration } test_go() {