Fix detection of version of arvados/jobs image to install.
[arvados-dev.git] / jenkins / run-tapestry-tests.sh
1 #!/bin/bash
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: AGPL-3.0
6
7 EXITCODE=0
8
9 COLUMNS=80
10
11 title () {
12   printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
13 }
14
15 source /etc/profile.d/rvm.sh
16
17 # This shouldn't really be necessary... but the jenkins/rvm integration seems a
18 # bit wonky occasionally.
19 rvm use ree
20
21 echo $WORKSPACE
22
23 # Tapestry
24 title "Starting tapestry tests"
25 cd "$WORKSPACE"
26
27 # There are a few submodules
28 git submodule init && git submodule update
29
30 # Use sqlite for testing
31 sed -i'' -e "s:mysql:sqlite3:" Gemfile
32
33 # Tapestry is not set up yet to use --deployment
34 #bundle install --deployment
35 bundle install
36
37 rm -f config/database.yml
38 rm -f config/environments/test.rb
39 cp $HOME/tapestry/test.rb config/environments/
40 cp $HOME/tapestry/database.yml config/
41
42 export RAILS_ENV=test
43
44 bundle exec rake db:drop
45 bundle exec rake db:create
46 bundle exec rake db:setup
47 bundle exec rake test
48
49 ECODE=$?
50
51 if [[ "$ECODE" != "0" ]]; then
52   title "!!!!!! TAPESTRY TESTS FAILED !!!!!!"
53   EXITCODE=$(($EXITCODE + $ECODE))
54 fi
55
56 title "Tapestry tests complete"
57
58 exit $EXITCODE