-
Notifications
You must be signed in to change notification settings - Fork 4
/
run-integration-tests
executable file
·83 lines (64 loc) · 1.43 KB
/
run-integration-tests
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash --login
# '--login' is needed to deal with the following warning otherwise emitted by rvm:
# You need to change your terminal emulator preferences to allow login shell.
# Sometimes it is required to use `/bin/bash --login` as the command.
# Please visit https://rvm.io/integration/gnome-terminal/ for a example.
rvm gemset create observed-test
rvm gemset use observed-test
gem install bundler
observed_dir=`dirname $0`
cd $observed_dir
observed_dir=`pwd`
plugins_dir=$observed_dir/plugins
integrations_dir=$observed_dir/integrations
integrations="clockwork eventmachine"
plugins="http fluentd gauge"
#cd $observed_dir
dirs=$observed_dir
for integration in $integrations
do
dirs="$dirs $integrations_dir/observed-$integration"
done
for plugin in $plugins
do
dirs="$dirs $plugins_dir/observed-$plugin"
done
echo $dirs
function quit_on_failure {
if [[ $? -ne 0 ]]; then
quit 1
fi
}
function quit {
rvm --force gemset delete observed-test
if [[ $1 == "" ]]; then
exit 0
fi
exit $1
}
for target in $dirs
do
echo Target: $target
cd $target
echo Current directory: `pwd`
export BUNDLE_GEMFILE=$target/Gemfile
bundle install
if [[ $? -ne 0 ]]; then
bundle update
fi
if [ -d spec ]
then
bundle exec rspec
fi
quit_on_failure
if [ -d features ]
then
bundle exec cucumber
fi
quit_on_failure
rake install
if [[ $? -ne 0 ]]; then
gem install pkg/*.gem
fi
done
quit