Commit 0c545bbb35bcc631e9b6f52b06b2cd339d3fa61e
Exists in
master
and in
90 other branches
Merge branch 'load_shunit2'
See merge request !1
Showing
9 changed files
with
19 additions
and
8 deletions
Show diff stats
test/colab_test.sh
@@ -29,4 +29,4 @@ test_reverse_proxy_gitlab() { | @@ -29,4 +29,4 @@ test_reverse_proxy_gitlab() { | ||
29 | assertTrue 'Reverse proxy for gitlab' "curl --header 'Host: softwarepublico.dev' http://$integration/gitlab/public/projects | grep -i '<meta.*gitlab.*>'" | 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,4 +22,4 @@ test_redirects_to_the_correct_host() { | ||
22 | assertEquals "Location: https://softwarepublico.dev/gitlab/users/sign_in" "$redirect" | 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
test/mailman_api_test.sh
test/mailman_test.sh
@@ -25,4 +25,4 @@ test_mailman_web_interface() { | @@ -25,4 +25,4 @@ test_mailman_web_interface() { | ||
25 | assertEquals "<TITLE>listas.softwarepublico.dev Mailing Lists</TITLE>" "$title" | 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,5 +12,5 @@ test_gitlab_database_created() { | ||
12 | assertTrue 'gitlab database created in PostgreSQL' 'run_on database sudo -u postgres -i psql gitlab < /dev/null' | 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,4 +8,4 @@ test_redis_listens_on_local_network() { | ||
8 | assertTrue 'redis listening on local network' 'nc -z -w 1 $database 6379' | 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,4 +15,4 @@ test_redirect_http_to_mailman() { | ||
15 | assertEquals "<TITLE>listas.softwarepublico.dev Mailing Lists</TITLE>" "$title" | 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,4 +7,15 @@ run_on() { | ||
7 | echo 'export PATH=/vagrant/test/bin:$PATH;' "$@" | ssh -F .ssh_config "$vm" | 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 | . $(dirname $0)/ip_helper.sh | 20 | . $(dirname $0)/ip_helper.sh |
21 | + |