|
1 | 1 | #!/usr/bin/env bash |
2 | 2 | set -e |
3 | 3 |
|
4 | | -echo "::group::Setting up variables and helpers ..." |
| 4 | +source "$(dirname $0)/install/_lib.sh" |
| 5 | + |
| 6 | +echo "${_group}Setting up variables and helpers ..." |
5 | 7 | export SENTRY_TEST_HOST="${SENTRY_TEST_HOST:-http://localhost:9000}" |
6 | 8 | |
7 | 9 | TEST_PASS='test123TEST' |
@@ -32,17 +34,17 @@ cleanup () { |
32 | 34 | echo "Done." |
33 | 35 | } |
34 | 36 | trap_with_arg cleanup ERR INT TERM EXIT |
35 | | -echo "::endgroup::" |
| 37 | +echo "${_endgroup}" |
36 | 38 |
|
37 | | -echo "::group::Starting Sentry for tests ..." |
| 39 | +echo "${_group}Starting Sentry for tests ..." |
38 | 40 | # Disable beacon for e2e tests |
39 | 41 | echo 'SENTRY_BEACON=False' >> sentry/sentry.conf.py |
40 | | -docker-compose run --rm web createuser --superuser --email $TEST_USER --password $TEST_PASS || true |
41 | | -docker-compose up -d |
| 42 | +$dcr web createuser --superuser --email $TEST_USER --password $TEST_PASS || true |
| 43 | +$dc up -d |
42 | 44 | printf "Waiting for Sentry to be up"; timeout 60 bash -c 'until $(curl -Isf -o /dev/null $SENTRY_TEST_HOST); do printf '.'; sleep 0.5; done' |
43 | | -echo "::endgroup::" |
| 45 | +echo "${_endgroup}" |
44 | 46 |
|
45 | | -echo "::group::Running tests ..." |
| 47 | +echo "${_group}Running tests ..." |
46 | 48 | get_csrf_token () { awk '$6 == "sc" { print $7 }' $COOKIE_FILE; } |
47 | 49 | sentry_api_request () { curl -s -H 'Accept: application/json; charset=utf-8' -H "Referer: $SENTRY_TEST_HOST" -H 'Content-Type: application/json' -H "X-CSRFToken: $(get_csrf_token)" -b "$COOKIE_FILE" -c "$COOKIE_FILE" "$SENTRY_TEST_HOST/api/0/$1" ${@:2}; } |
48 | 50 |
|
|
75 | 77 | echo "$LOGIN_RESPONSE" | grep "$i[,}]" >& /dev/null |
76 | 78 | echo "Pass." |
77 | 79 | done |
78 | | -echo "::endgroup::" |
| 80 | +echo "${_endgroup}" |
79 | 81 |
|
80 | | -echo "::group::Running moar tests !!!" |
| 82 | +echo "${_group}Running moar tests !!!" |
81 | 83 | # Set up initial/required settings (InstallWizard request) |
82 | 84 | sentry_api_request "internal/options/?query=is:required" -X PUT --data '{"mail.use-tls":false,"mail.username":"","mail.port":25,"system.admin-email":"[email protected]","mail.password":"","mail.from":"root@localhost","system.url-prefix":"'"$SENTRY_TEST_HOST"'","auth.allow-registration":false,"beacon.anonymous":true}' > /dev/null |
83 | 85 |
|
|
112 | 114 | echo "$EVENT_RESPONSE" | grep "$i[,}]" >& /dev/null |
113 | 115 | echo "Pass." |
114 | 116 | done |
115 | | -echo "::endgroup::" |
| 117 | +echo "${_endgroup}" |
116 | 118 |
|
117 | | -echo "::group::Ensure cleanup crons are working ..." |
118 | | -docker-compose ps | grep -q -- "-cleanup_.\+[[:space:]]\+Up[[:space:]]\+" |
119 | | -echo "::endgroup::" |
| 119 | +echo "${_group}Ensure cleanup crons are working ..." |
| 120 | +$dc ps | grep -q -- "-cleanup_.\+[[:space:]]\+Up[[:space:]]\+" |
| 121 | +echo "${_endgroup}" |
0 commit comments