Commit 5191583f0b3e38fb93a4556e5616b66d1eb5e29f

Authored by Diego Camarinha
Committed by Paulo Meireles
1 parent 5dd4ae47

[Mezuro] Creating mysql script for deleting datase entries.

features/support/hooks.rb 0 → 100644
@@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
  1 +After ('@kalibro_restart') do
  2 + command = "#{RAILS_ROOT}/plugins/mezuro/script/delete_all_kalibro_entries.sh"
  3 + system command
  4 +end
plugins/mezuro/script/delete_all_kalibro_entries.sh 0 → 100755
@@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
  1 +#!/bin/bash
  2 +
  3 +DATABASE="kalibro_tests"
  4 +USER="kalibro"
  5 +PASSWORD="kalibro"
  6 +MYSQL_PARAMS="$DATABASE -u $USER -p$PASSWORD"
  7 +TABLES=($(mysql $MYSQL_PARAMS -e "show tables"))
  8 +LENGTH=${#TABLES}
  9 +
  10 +i=1
  11 +while [ $i -le $LENGTH ]
  12 + do if [ ${#TABLES[$i]} -ne 0 ]
  13 + then mysql --force $MYSQL_PARAMS -e "delete from $DATABASE.${TABLES[$i]}"
  14 + fi
  15 + i=$(($i+1))
  16 +done
plugins/mezuro/script/run_acceptance_tests.sh 0 → 100755
@@ -0,0 +1,42 @@ @@ -0,0 +1,42 @@
  1 +#!/bin/bash
  2 +
  3 +TEST_FILE=$1
  4 +PROFILE=$2
  5 +
  6 +if [ -z "$PROFILE" ]; then
  7 + PROFILE='default'
  8 +fi
  9 +
  10 +# where are your .kalibro dir?
  11 +KALIBRO_HOME='/usr/share/tomcat6/.kalibro'
  12 +
  13 +# create a kalibro test dir
  14 +echo "--> Creating tests directory"
  15 +sudo mkdir $KALIBRO_HOME/tests
  16 +echo "--> Copying test settings"
  17 +sudo cp $KALIBRO_HOME/kalibro_tests.settings $KALIBRO_HOME/tests/kalibro.settings
  18 +echo "--> Changing owner of tests directory to tomcat6"
  19 +sudo chown -R tomcat6:tomcat6 $KALIBRO_HOME/tests
  20 +
  21 +# you must restart tomcat6
  22 +#if you are using a tomcat installed from apt-get, for example:
  23 +sudo service tomcat6 restart
  24 +
  25 +#if you are using a tomcat installed a specific dir, for exemple:
  26 +#~/tomcat6/bin/shoutdown.sh
  27 +#~/tomcat6/bin/startup.sh
  28 +
  29 +# run test
  30 +cucumber $TEST_FILE -p $PROFILE
  31 +
  32 +#back to normal mode
  33 +echo "--> Removing tests directory"
  34 +sudo rm -rf $KALIBRO_HOME/tests
  35 +
  36 +# you must restart tomcat6 again
  37 +sudo service tomcat6 restart
  38 +
  39 +#or some thing like that...
  40 +#~/tomcat6/bin/shoutdown.sh
  41 +#~/tomcat6/bin/startup.sh
  42 +
plugins/mezuro/test/run_acceptance_tests.sh
@@ -1,42 +0,0 @@ @@ -1,42 +0,0 @@
1 -#!/bin/bash  
2 -  
3 -TEST_FILE=$1  
4 -PROFILE=$2  
5 -  
6 -if [ -z "$PROFILE" ]; then  
7 - PROFILE='default'  
8 -fi  
9 -  
10 -# where are your .kalibro dir?  
11 -KALIBRO_HOME='/usr/share/tomcat6/.kalibro'  
12 -  
13 -# create a kalibro test dir  
14 -echo "--> Creating tests directory"  
15 -sudo mkdir $KALIBRO_HOME/tests  
16 -echo "--> Copying test settings"  
17 -sudo cp $KALIBRO_HOME/kalibro_tests.settings $KALIBRO_HOME/tests/kalibro.settings  
18 -echo "--> Changing owner of tests directory to tomcat6"  
19 -sudo chown -R tomcat6:tomcat6 $KALIBRO_HOME/tests  
20 -  
21 -# you must restart tomcat6  
22 -#if you are using a tomcat installed from apt-get, for example:  
23 -sudo service tomcat6 restart  
24 -  
25 -#if you are using a tomcat installed a specific dir, for exemple:  
26 -#~/tomcat6/bin/shoutdown.sh  
27 -#~/tomcat6/bin/startup.sh  
28 -  
29 -# run test  
30 -cucumber $TEST_FILE -p $PROFILE  
31 -  
32 -#back to normal mode  
33 -echo "--> Removing tests directory"  
34 -sudo rm -rf $KALIBRO_HOME/tests  
35 -  
36 -# you must restart tomcat6 again  
37 -sudo service tomcat6 restart  
38 -  
39 -#or some thing like that...  
40 -#~/tomcat6/bin/shoutdown.sh  
41 -#~/tomcat6/bin/startup.sh  
42 -