Commit 0c545bbb35bcc631e9b6f52b06b2cd339d3fa61e

Authored by Antonio Terceiro
2 parents 5d043b88 d3d9c0d6

Merge branch 'load_shunit2'

See merge request !1
test/colab_test.sh
... ... @@ -29,4 +29,4 @@ test_reverse_proxy_gitlab() {
29 29 assertTrue 'Reverse proxy for gitlab' "curl --header 'Host: softwarepublico.dev' http://$integration/gitlab/public/projects | grep -i '<meta.*gitlab.*>'"
30 30 }
31 31  
32   -. shunit2
  32 +load_shunit2
... ...
test/gitlab_test.sh
... ... @@ -22,4 +22,4 @@ test_redirects_to_the_correct_host() {
22 22 assertEquals "Location: https://softwarepublico.dev/gitlab/users/sign_in" "$redirect"
23 23 }
24 24  
25   -. shunit2
  25 +load_shunit2
... ...
test/mail_relay_test.sh
... ... @@ -40,5 +40,5 @@ test_outbound_email_reverseproxy() {
40 40 _test_outbound_email reverseproxy
41 41 }
42 42  
43   -. shunit2
  43 +load_shunit2
44 44  
... ...
test/mailman_api_test.sh
... ... @@ -4,5 +4,5 @@ test_mailman_api_running() {
4 4 assertTrue 'mailman running' 'run_on integration pgrep -fa mailman-api'
5 5 }
6 6  
7   -. shunit2
  7 +load_shunit2
8 8  
... ...
test/mailman_test.sh
... ... @@ -25,4 +25,4 @@ test_mailman_web_interface() {
25 25 assertEquals "<TITLE>listas.softwarepublico.dev Mailing Lists</TITLE>" "$title"
26 26 }
27 27  
28   -. shunit2
  28 +load_shunit2
... ...
test/postgresql_test.sh
... ... @@ -12,5 +12,5 @@ test_gitlab_database_created() {
12 12 assertTrue 'gitlab database created in PostgreSQL' 'run_on database sudo -u postgres -i psql gitlab < /dev/null'
13 13 }
14 14  
15   -. shunit2
  15 +load_shunit2
16 16  
... ...
test/redis_test.sh
... ... @@ -8,4 +8,4 @@ test_redis_listens_on_local_network() {
8 8 assertTrue 'redis listening on local network' 'nc -z -w 1 $database 6379'
9 9 }
10 10  
11   -. shunit2
  11 +load_shunit2
... ...
test/reverse_proxy_test.sh
... ... @@ -15,4 +15,4 @@ test_redirect_http_to_mailman() {
15 15 assertEquals "<TITLE>listas.softwarepublico.dev Mailing Lists</TITLE>" "$title"
16 16 }
17 17  
18   -. shunit2
  18 +load_shunit2
... ...
test/test_helper.sh
... ... @@ -7,4 +7,15 @@ run_on() {
7 7 echo 'export PATH=/vagrant/test/bin:$PATH;' "$@" | ssh -F .ssh_config "$vm"
8 8 }
9 9  
  10 +load_shunit2() {
  11 + if [ `which shunit2 > /dev/null 2>&1` ]; then
  12 + . shunit2
  13 + elif [ -e /usr/share/shunit2/shunit2 ]; then
  14 + . /usr/share/shunit2/shunit2
  15 + else
  16 + echo "Could not find shunit2, please, make sure you have it installed."
  17 + fi
  18 +}
  19 +
10 20 . $(dirname $0)/ip_helper.sh
  21 +
... ...