7 ARVADOS_API_HOST=qr1hi.arvadosapi.com
10 printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
13 source /etc/profile.d/rvm.sh
16 export GOPATH=$(mktemp -d)
17 mkdir -p "$GOPATH/src/git.curoverse.com"
18 ln -sfn "$WORKSPACE" "$GOPATH/src/git.curoverse.com/arvados.git"
21 virtualenv --setuptools "$VENVDIR"
22 PATH="$VENVDIR/bin:$PATH"
25 title "Starting DOC build"
28 bundle install --deployment
30 # Make sure python-epydoc is installed or the next line won't do much good!
31 PYTHONPATH=$WORKSPACE/sdk/python/ bundle exec rake generate baseurl=file://$WORKSPACE/doc/.site/ arvados_workbench_host=workbench.$ARVADOS_API_HOST arvados_api_host=$ARVADOS_API_HOST
36 if [[ "$ECODE" != "0" ]]; then
37 title "!!!!!! $1 FAILED !!!!!!"
38 EXITCODE=$(($EXITCODE + $ECODE))
43 go get -t "git.curoverse.com/arvados.git/$1"
44 checkexit "$1 install"
48 title "Starting $1 tests"
51 go test "git.curoverse.com/arvados.git/$1"
54 title "$1 tests complete"
58 title "DOC build complete"
61 title "Starting DOC linkchecker"
64 bundle exec rake linkchecker baseurl=file://$WORKSPACE/doc/.site/
66 checkexit "Doc linkchecker"
67 title "DOC linkchecker complete"
70 title "Starting API server tests"
73 bundle install --deployment
75 rm -f config/database.yml
76 rm -f config/environments/test.rb
77 cp config/environments/test.rb.example config/environments/test.rb
79 # Get test database config
80 cp $HOME/arvados-api-server/database.yml config/
81 # Get test application.yml file
82 cp $HOME/arvados-api-server/application.yml config/
84 # Fill in a random secret_token and blob_signing_key for testing
85 SECRET_TOKEN=`echo 'puts rand(2**512).to_s(36)' |ruby`
86 BLOB_SIGNING_KEY=`echo 'puts rand(2**512).to_s(36)' |ruby`
88 sed -i'' -e "s:SECRET_TOKEN:$SECRET_TOKEN:" config/application.yml
89 sed -i'' -e "s:BLOB_SIGNING_KEY:$BLOB_SIGNING_KEY:" config/application.yml
93 # Set up empty git repo (for git tests)
94 GITDIR=$WORKSPACE/tmpgit
97 sed -i'' -e "s:/var/cache/git:$GITDIR:" config/application.default.yml
100 mkdir -p $GITDIR/test
103 /usr/bin/git config user.email "jenkins@ci.curoverse.com"
104 /usr/bin/git config user.name "Jenkins, CI"
107 /usr/bin/git commit -m 'initial commit'
112 bundle exec rake db:drop
113 bundle exec rake db:create
114 bundle exec rake db:setup
115 bundle exec rake test
117 checkexit "API server tests"
118 title "API server tests complete"
120 # Install CLI gem's dependencies.
122 cd "$WORKSPACE/sdk/cli"
123 bundle install --deployment
126 gostuff="services/keepstore services/keepproxy sdk/go/arvadosclient sdk/go/keepclient sdk/go/streamer"
132 # Install the Python SDK early. Various other test suites (like
133 # keepproxy) bring up run_test_server.py, which imports the arvados
134 # module. We can't actually *test* the Python SDK yet though, because
135 # its own test suite brings up some of those other programs (like
138 cd "$WORKSPACE/sdk/python"
139 python setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1 --match .tar.gz
140 pip install dist/arvados-python-client-0.1.*.tar.gz
142 checkexit "Python SDK install"
144 cd "$WORKSPACE/services/fuse"
145 python setup.py egg_info -b ".$(git log --format=format:%ct.%h -n1 .)" sdist rotate --keep=1 --match .tar.gz
146 pip install dist/arvados_fuse-0.1.*.tar.gz
148 checkexit "FUSE install"
150 # Python SDK. We test this before testing keepproxy: keepproxy runs
151 # run_test_server.py, which depends on the yaml package, which is in
152 # tests_require but not install_requires, and therefore does not get
153 # installed by setuptools until we run "setup.py test" *and* install
154 # the .egg files that setup.py downloads.
156 title "Starting Python SDK tests"
157 cd "$WORKSPACE/sdk/python"
160 checkexit "Python SDK tests"
163 title "Python tests complete"
167 title "Starting FUSE tests"
168 cd "$WORKSPACE/services/fuse"
171 checkexit "FUSE tests"
174 title "FUSE tests complete"
185 title "Starting workbench tests"
188 bundle install --deployment
192 bundle exec rake test
194 checkexit "Workbench tests"
195 title "Workbench tests complete"
197 # Clean up temporary virtualenv and GOPATH
201 # The CLI SDK tests require a working API server, so let's skip those for now.
204 ########################################################################
207 title "Starting SDK CLI tests"
210 bundle install --deployment
212 # Set up Python SDK and dependencies
214 rm -rf $HOME/lib/python
215 mkdir $HOME/lib/python
216 PYTHONPATH="$HOME/lib/python" easy_install --install-dir=$HOME/lib/python --upgrade google-api-python-client
217 PYTHONPATH="$HOME/lib/python" python setup.py install --home=$HOME
221 export KEEP_LOCAL_STORE=/tmp/keep
222 PYTHONPATH="$HOME/lib/python" bundle exec rake test
224 checkexit "SDK CLI tests"
225 title "SDK CLI tests complete"