Skip to content

Commit ae93788

Browse files
authored
fix(py3): Make event ingestion test more robust (#693)
We were relying on the public DSN field coming first from the API and with Python 3, that's not the case to the tests were failing. This PR makes DSN extraction a bit more robust while still avoiding a full-fledged JSON parser.
1 parent acbaec6 commit ae93788

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ done
7474
# Set up initial/required settings (InstallWizard request)
7575
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
7676

77-
SENTRY_DSN=$(sentry_api_request "projects/sentry/internal/keys/" | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "public" { print $4; exit; }')
77+
SENTRY_DSN=$(sentry_api_request "projects/sentry/internal/keys/" | awk 'BEGIN { RS=",|:{\n"; FS="\""; } $2 == "public" && $4 ~ "^http" { print $4; exit; }')
7878
# We ignore the protocol and the host as we already know those
7979
DSN_PIECES=(`echo $SENTRY_DSN | sed -ne 's|^https\?://\([0-9a-z]\+\)@[^/]\+/\([0-9]\+\)$|\1\n\2|p'`)
8080
SENTRY_KEY=${DSN_PIECES[0]}

0 commit comments

Comments
 (0)