X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/1c40d138c5de3ed5e27437edc5cbb6b84da29fc3..5b0b92405919dd8f7bf10e0a2068d5f1e1816d84:/build/run-tests.sh diff --git a/build/run-tests.sh b/build/run-tests.sh index a5c7277580..70437bd21c 100755 --- a/build/run-tests.sh +++ b/build/run-tests.sh @@ -38,8 +38,6 @@ services/api_test="TEST=test/functional/arvados/v1/collections_controller_test.r Restrict apiserver tests to the given file sdk/python_test="--test-suite tests.test_keep_locator" Restrict Python SDK tests to the given class -apps/workbench_test="TEST=test/integration/pipeline_instances_test.rb" - Restrict Workbench tests to the given file services/githttpd_test="-check.vv" Show all log messages, even when tests pass (also works with services/keepstore_test etc.) @@ -62,12 +60,6 @@ https://dev.arvados.org/projects/arvados/wiki/Running_tests Available tests: -apps/workbench (*) -apps/workbench_units (*) -apps/workbench_functionals (*) -apps/workbench_integration (*) -apps/workbench_benchmark -apps/workbench_profile cmd/arvados-client cmd/arvados-package cmd/arvados-server @@ -94,7 +86,6 @@ lib/pam lib/service services/api services/githttpd -services/crunchstat services/dockercleaner services/fuse services/fuse:py3 @@ -106,10 +97,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 @@ -133,9 +127,6 @@ tools/keep-exercise tools/keep-rsync tools/keep-block-check -(*) apps/workbench is shorthand for apps/workbench_units + - apps/workbench_functionals + apps/workbench_integration - EOF # First make sure to remove any ARVADOS_ variables from the calling @@ -182,10 +173,6 @@ fatal() { exit_cleanly() { trap - INT - if which create-plot-data-from-log.sh >/dev/null; then - create-plot-data-from-log.sh $BUILD_NUMBER "$WORKSPACE/apps/workbench/log/test.log" "$WORKSPACE/apps/workbench/log/" - fi - rotate_logfile "$WORKSPACE/apps/workbench/log/" "test.log" stop_services rotate_logfile "$WORKSPACE/services/api/log/" "test.log" report_outcomes @@ -236,7 +223,7 @@ sanity_checks() { || fatal "No gitolite. Try: apt-get install gitolite3" echo -n 'npm: ' npm --version \ - || fatal "No npm. Try: wget -O- https://nodejs.org/dist/v10.23.1/node-v10.23.1-linux-x64.tar.xz | sudo tar -C /usr/local -xJf - && sudo ln -s ../node-v10.23.1-linux-x64/bin/{node,npm} /usr/local/bin/" + || fatal "No npm. Try: wget -O- https://nodejs.org/dist/v12.22.12/node-v12.22.12-linux-x64.tar.xz | sudo tar -C /usr/local -xJf - && sudo ln -s ../node-v12.22.12-linux-x64/bin/{node,npm} /usr/local/bin/" echo -n 'cadaver: ' cadaver --version | grep -w cadaver \ || fatal "No cadaver. Try: apt-get install cadaver" @@ -254,14 +241,10 @@ sanity_checks() { || fatal "No libpam pam_appl.h. Try: apt-get install libpam0g-dev" echo -n 'postgresql: ' psql --version || fatal "No postgresql. Try: apt-get install postgresql postgresql-client-common" - echo -n 'phantomjs: ' - phantomjs --version || fatal "No phantomjs. Try: apt-get install phantomjs" echo -n 'xvfb: ' which Xvfb || fatal "No xvfb. Try: apt-get install xvfb" echo -n 'graphviz: ' dot -V || fatal "No graphviz. Try: apt-get install graphviz" - echo -n 'geckodriver: ' - geckodriver --version | grep ^geckodriver || echo "No geckodriver. Try: arvados-server install" echo -n 'singularity: ' singularity --version || fatal "No singularity. Try: arvados-server install" echo -n 'docker client: ' @@ -287,7 +270,7 @@ sanity_checks() { } rotate_logfile() { - # i.e. rotate_logfile "$WORKSPACE/apps/workbench/log/" "test.log" + # i.e. rotate_logfile "$WORKSPACE/services/api/log/" "test.log" # $BUILD_NUMBER is set by Jenkins if this script is being called as part of a Jenkins run if [[ -f "$1/$2" ]]; then THEDATE=`date +%Y%m%d%H%M%S` @@ -300,7 +283,6 @@ declare -a failures declare -A skip declare -A only declare -A testargs -skip[apps/workbench_profile]=1 while [[ -n "$1" ]] do @@ -590,7 +572,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() { @@ -653,22 +635,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() { @@ -696,8 +670,8 @@ retry() { do_test() { case "${1}" in - apps/workbench_units | apps/workbench_functionals | apps/workbench_integration) - suite=apps/workbench + services/workbench2_units | services/workbench2_integration) + suite=services/workbench2 ;; *) suite="${1}" @@ -713,7 +687,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 ;; @@ -909,6 +897,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" \ @@ -921,6 +913,7 @@ install_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 } @@ -987,11 +980,9 @@ pythonstuff=( declare -a gostuff gostuff=($(cd "$WORKSPACE" && git ls-files | grep '\.go$' | sed -e 's/\/[^\/]*$//' | sort -u)) -install_apps/workbench() { - cd "$WORKSPACE/apps/workbench" \ - && mkdir -p tmp/cache \ - && RAILS_ENV=test bundle_install_trylocal \ - && 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() { @@ -1009,6 +1000,7 @@ test_gofmt() { cd "$WORKSPACE" || return 1 dirs=$(ls -d */ | egrep -v 'vendor|tmp') [[ -z "$(gofmt -e -d $dirs | tee -a /dev/stderr)" ]] + go vet -composites=false ./... } test_services/api() { @@ -1022,6 +1014,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" \ @@ -1044,34 +1041,12 @@ test_services/login-sync() { && "$bundle" exec rake test TESTOPTS=-v ${testargs[services/login-sync]} } -test_apps/workbench_units() { - local TASK="test:units" - cd "$WORKSPACE/apps/workbench" \ - && eval env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} "$bundle" exec rake ${TASK} TESTOPTS=\'-v -d\' ${testargs[apps/workbench]} ${testargs[apps/workbench_units]} -} - -test_apps/workbench_functionals() { - local TASK="test:functionals" - cd "$WORKSPACE/apps/workbench" \ - && eval env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} "$bundle" exec rake ${TASK} TESTOPTS=\'-v -d\' ${testargs[apps/workbench]} ${testargs[apps/workbench_functionals]} -} - -test_apps/workbench_integration() { - local TASK="test:integration" - cd "$WORKSPACE/apps/workbench" \ - && eval env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} "$bundle" exec rake ${TASK} TESTOPTS=\'-v -d\' ${testargs[apps/workbench]} ${testargs[apps/workbench_integration]} -} - -test_apps/workbench_benchmark() { - local TASK="test:benchmark" - cd "$WORKSPACE/apps/workbench" \ - && eval env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} "$bundle" exec rake ${TASK} ${testargs[apps/workbench_benchmark]} +test_services/workbench2_units() { + cd "$WORKSPACE/services/workbench2" && make unit-tests ARVADOS_DIRECTORY="${WORKSPACE}" WORKSPACE="$(pwd)" ${testargs[services/workbench2]} } -test_apps/workbench_profile() { - local TASK="test:profile" - cd "$WORKSPACE/apps/workbench" \ - && eval env RAILS_ENV=test ${short:+RAILS_TEST_SHORT=1} "$bundle" exec rake ${TASK} ${testargs[apps/workbench_profile]} +test_services/workbench2_integration() { + cd "$WORKSPACE/services/workbench2" && make integration-tests ARVADOS_DIRECTORY="${WORKSPACE}" WORKSPACE="$(pwd)" ${testargs[services/workbench2]} } install_deps() { @@ -1080,6 +1055,7 @@ install_deps() { do_install cmd/arvados-server go do_install sdk/cli 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 @@ -1089,6 +1065,7 @@ 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/cli @@ -1105,7 +1082,7 @@ install_all() { do_install "$g" go done do_install services/api - do_install apps/workbench + do_install services/workbench2 } test_all() { @@ -1121,6 +1098,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 @@ -1138,11 +1116,8 @@ test_all() { do do_test "$g" go done - do_test apps/workbench_units - do_test apps/workbench_functionals - 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() { @@ -1183,11 +1158,6 @@ done testfuncargs["sdk/cli"]="sdk/cli" testfuncargs["sdk/R"]="sdk/R" testfuncargs["sdk/java-v2"]="sdk/java-v2" -testfuncargs["apps/workbench_units"]="apps/workbench_units" -testfuncargs["apps/workbench_functionals"]="apps/workbench_functionals" -testfuncargs["apps/workbench_integration"]="apps/workbench_integration" -testfuncargs["apps/workbench_benchmark"]="apps/workbench_benchmark" -testfuncargs["apps/workbench_profile"]="apps/workbench_profile" if [[ -z ${interactive} ]]; then install_all