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