Commit 2711a1d52acb114ae177e207dbaa0b199d91183b

Authored by Rafael Manzo
1 parent ac30fdd5

[Mezuro] Acceptance tests script doesn't depends anymore of a clone from the Kal…

…ibro source code repository
features/support/hooks.rb
1 -Before do  
2 - if !$dunit 1 +Before do
  2 + if !$dunit
3 command = "#{RAILS_ROOT}/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh" 3 command = "#{RAILS_ROOT}/plugins/mezuro/script/tests/prepare_kalibro_query_file.sh"
4 system command 4 system command
5 - $dunit = true  
6 - end  
7 -end 5 + $dunit = true
  6 + end
  7 +end
8 8
9 After ('@kalibro_restart') do 9 After ('@kalibro_restart') do
10 command = "#{RAILS_ROOT}/plugins/mezuro/script/tests/delete_all_kalibro_entries.sh" 10 command = "#{RAILS_ROOT}/plugins/mezuro/script/tests/delete_all_kalibro_entries.sh"
plugins/mezuro/script/tests/kalibro_scripts.conf
1 # Definition of constants used in kalibro scripts. 1 # Definition of constants used in kalibro scripts.
2 2
3 -KALIBRO_DIR=~/kalibro  
4 -PSQLFILE=$KALIBRO_DIR/KalibroCore/src/META-INF/PostgreSQL.sql 3 +PSQLFILE=/tmp/PostgreSQL.sql
5 DATABASE="kalibro_test" 4 DATABASE="kalibro_test"
6 PASSWORD="kalibro" 5 PASSWORD="kalibro"
7 -QUERYFILE=/tmp/query  
8 - 6 +QUERYFILE=/tmp/query
9 \ No newline at end of file 7 \ No newline at end of file
plugins/mezuro/script/tests/prepare_kalibro_query_file.sh
1 #!/bin/bash 1 #!/bin/bash
2 2
3 source plugins/mezuro/script/tests/kalibro_scripts.conf 3 source plugins/mezuro/script/tests/kalibro_scripts.conf
  4 +if ! [ -f $PSQLFILE ]
  5 + then wget http://gitorious.org/kalibro/kalibro/blobs/raw/master/KalibroCore/src/META-INF/PostgreSQL.sql -O $PSQLFILE
  6 +fi
4 7
5 DROPLIMIT="END OF DROP TABLES" 8 DROPLIMIT="END OF DROP TABLES"
6 RANGE=$(grep -n "$DROPLIMIT" $PSQLFILE | cut -d":" -f1) 9 RANGE=$(grep -n "$DROPLIMIT" $PSQLFILE | cut -d":" -f1)
@@ -14,4 +17,4 @@ if [ -f $QUERYFILE ] @@ -14,4 +17,4 @@ if [ -f $QUERYFILE ]
14 fi 17 fi
15 18
16 sed -e "$CUT" -e "$REPLACE" $PSQLFILE > $QUERYFILE 19 sed -e "$CUT" -e "$REPLACE" $PSQLFILE > $QUERYFILE
17 -sudo chown postgres.postgres $QUERYFILE 20 -sudo chown postgres.postgres $QUERYFILE
  21 +sudo chown postgres.postgres $QUERYFILE
18 \ No newline at end of file 22 \ No newline at end of file