#!/bin/bash
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
-. `dirname "$(readlink -f "$0")"`/libcloud-pin
+. `dirname "$(readlink -f "$0")"`/libcloud-pin.sh
COLUMNS=80
. `dirname "$(readlink -f "$0")"`/run-library.sh
services/keep-balance
services/login-sync
services/nodemanager
+services/nodemanager_integration
services/crunch-run
services/crunch-dispatch-local
services/crunch-dispatch-slurm
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/health
sdk/go/httpserver
sdk/go/manifest
sdk/go/blockdigest
echo -n 'ruby: '
ruby -v \
|| fatal "No ruby. Install >=2.1.9 (using rbenv, rvm, or source)"
- echo -n 'bundler: '
- bundle version \
- || fatal "No bundler. Try: gem install bundler"
echo -n 'go: '
go version \
|| fatal "No go binary. See http://golang.org/doc/install"
- [[ $(go version) =~ go1.([0-9]+) ]] && [[ ${BASH_REMATCH[1]} -ge 7 ]] \
- || fatal "Go >= 1.7 required. See http://golang.org/doc/install"
+ [[ $(go version) =~ go1.([0-9]+) ]] && [[ ${BASH_REMATCH[1]} -ge 8 ]] \
+ || fatal "Go >= 1.8 required. See http://golang.org/doc/install"
echo -n 'gcc: '
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 'gnutls.h: '
- find /usr/include -wholename '*gnutls/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 'pyconfig.h: '
- find /usr/include -name pyconfig.h | egrep --max-count=1 . \
- || fatal "No pyconfig.h. Try: apt-get install python-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"
echo -n 'gitolite: '
which gitolite \
|| fatal "No gitolite. Try: apt-get install gitolite3"
+ echo -n 'npm: '
+ npm --version \
+ || fatal "No npm. Try: wget -O- https://nodejs.org/dist/v6.11.2/node-v6.11.2-linux-x64.tar.xz | sudo tar -C /usr/local -xJf - && sudo ln -s ../node-v6.11.2-linux-x64/bin/{node,npm} /usr/local/bin/"
+ echo -n 'cadaver: '
+ cadaver --version | grep -w cadaver \
+ || fatal "No cadaver. Try: apt-get install cadaver"
}
rotate_logfile() {
tmpdir_gem_home="$(env - PATH="$PATH" HOME="$GEMHOME" gem env gempath | cut -f1 -d:)"
PATH="$tmpdir_gem_home/bin:$PATH"
- export GEM_PATH="$tmpdir_gem_home:$(gem env gempath)"
+ export GEM_PATH="$tmpdir_gem_home"
echo "Will install dependencies to $(gem env gemdir)"
echo "Will install arvados gems to $tmpdir_gem_home"
echo "Gem search path is GEM_PATH=$GEM_PATH"
fi
+ bundle config || gem install bundler \
+ || fatal 'install bundler'
}
with_test_gemset() {
mkdir -p "$GOPATH/src/git.curoverse.com"
ln -sfT "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git" \
|| fatal "symlink failed"
+go get -v github.com/kardianos/govendor \
+ || fatal "govendor install failed"
setup_virtualenv "$VENVDIR" --python python2.7
. "$VENVDIR/bin/activate"
|| pip install --pre --ignore-installed https://github.com/curoverse/libcloud/archive/apache-libcloud-$LIBCLOUD_PIN.zip >/dev/null \
|| fatal "pip install apache-libcloud failed"
-# 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
+# We need an unreleased (as of 2017-08-17) llfuse bugfix, otherwise our fuse test suite deadlocks.
+pip freeze | grep -x llfuse==1.2.0 || (
+ set -e
+ yes | pip uninstall llfuse || true
+ cython --version || fatal "no cython; try sudo apt-get install cython"
+ cd "$temp"
+ (cd python-llfuse 2>/dev/null || git clone https://github.com/curoverse/python-llfuse)
+ cd python-llfuse
+ git checkout 620722fd990ea642ddb8e7412676af482c090c0c
+ git checkout setup.py
+ sed -i -e "s:'1\\.2':'1.2.0':" setup.py
+ python setup.py build_cython
+ python setup.py install --force
+) || fatal "llfuse fork failed"
+pip freeze | grep -x llfuse==1.2.0 || fatal "error: installed llfuse 1.2.0 but '$(pip freeze | grep llfuse)' ???"
# 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 <<EOF
-Warning: python3 could not be found
-services/dockercleaner install and tests will be skipped
+Warning: python3 could not be found. Python 3 tests will be skipped.
EOF
fi
apps/workbench_units | apps/workbench_functionals | apps/workbench_integration)
suite=apps/workbench
;;
+ services/nodemanager | services/nodemanager_integration)
+ suite=services/nodemanager_suite
+ ;;
*)
suite="${1}"
;;
# mode makes Go show the wrong line numbers when reporting
# compilation errors.
go get -t "git.curoverse.com/arvados.git/$1" && \
- cd "$WORKSPACE/$1" && \
+ cd "$GOPATH/src/git.curoverse.com/arvados.git/$1" && \
[[ -z "$(gofmt -e -d . | tee /dev/stderr)" ]] && \
if [[ -n "${testargs[$1]}" ]]
then
# module. We can't actually *test* the Python SDK yet though, because
# its own test suite brings up some of those other programs (like
# keepproxy).
-declare -a pythonstuff
-pythonstuff=(
- sdk/pam
- sdk/python
- sdk/cwl
- services/fuse
- services/nodemanager
- tools/crunchstat-summary
- )
for p in "${pythonstuff[@]}"
do
- do_install "$p" pip
+ dir=${p%:py3}
+ if [[ ${dir} = ${p} ]]; then
+ if [[ -z ${skip[python2]} ]]; then
+ do_install ${dir} pip
+ fi
+ elif [[ -n ${PYTHON3} ]]; then
+ if [[ -z ${skip[python3]} ]]; then
+ do_install ${dir} pip "$VENV3DIR/bin/"
+ fi
+ fi
done
-if [ -n "$PYTHON3" ]; then
- do_install services/dockercleaner pip "$VENV3DIR/bin/"
-fi
install_apiserver() {
cd "$WORKSPACE/services/api" \
if [ -n "$CONFIGSRC" ]
then
- for f in database.yml application.yml
+ for f in database.yml
do
cp "$CONFIGSRC/$f" config/ || fatal "$f"
done
fi
- # Fill in a random secret_token and blob_signing_key for testing
- SECRET_TOKEN=`echo 'puts rand(2**512).to_s(36)' |ruby`
- BLOB_SIGNING_KEY=`echo 'puts rand(2**512).to_s(36)' |ruby`
-
- sed -i'' -e "s:SECRET_TOKEN:$SECRET_TOKEN:" config/application.yml
- sed -i'' -e "s:BLOB_SIGNING_KEY:$BLOB_SIGNING_KEY:" config/application.yml
-
- # Set up empty git repo (for git tests)
- GITDIR=$(mktemp -d)
- sed -i'' -e "s:/var/cache/git:$GITDIR:" config/application.default.yml
-
- rm -rf $GITDIR
- mkdir -p $GITDIR/test
- cd $GITDIR/test \
- && git init \
- && git config user.email "jenkins@ci.curoverse.com" \
- && git config user.name "Jenkins, CI" \
- && touch tmp \
- && git add tmp \
- && git commit -m 'initial commit'
-
# Clear out any lingering postgresql connections to the test
# database, so that we can drop it. This assumes the current user
# is a postgresql superuser.
&& test_database=$(python -c "import yaml; print yaml.load(file('config/database.yml'))['test']['database']") \
&& psql "$test_database" -c "SELECT pg_terminate_backend (pg_stat_activity.procpid::int) FROM pg_stat_activity WHERE pg_stat_activity.datname = '$test_database';" 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 \
}
do_install services/api apiserver
+cd "$GOPATH/src/git.curoverse.com/arvados.git" && \
+ "$GOPATH/bin/govendor" sync -v || \
+ fatal "govendor sync failed"
declare -a gostuff
gostuff=(
sdk/go/arvados
sdk/go/arvadosclient
sdk/go/blockdigest
sdk/go/dispatch
+ sdk/go/health
sdk/go/httpserver
sdk/go/manifest
sdk/go/streamer
tools/keep-block-check
tools/keep-exercise
tools/keep-rsync
- )
+)
for g in "${gostuff[@]}"
do
do_install "$g" go
install_workbench() {
cd "$WORKSPACE/apps/workbench" \
&& mkdir -p tmp/cache \
- && RAILS_ENV=test bundle_install_trylocal
+ && RAILS_ENV=test bundle_install_trylocal \
+ && RAILS_ENV=test RAILS_GROUPS=assets bundle exec rake npm:install
}
do_install apps/workbench workbench
+unset http_proxy https_proxy no_proxy
+
test_doclinkchecker() {
(
set -e
exit_cleanly
fi
-start_api
+start_api || { stop_services; fatal "start_api"; }
test_ruby_sdk() {
cd "$WORKSPACE/sdk/ruby" \
}
do_test services/login-sync login-sync
+test_nodemanager_integration() {
+ cd "$WORKSPACE/services/nodemanager" \
+ && tests/integration_test.py ${testargs[services/nodemanager_integration]}
+}
+do_test services/nodemanager_integration nodemanager_integration
+
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