Skip to content

Commit 18081e7

Browse files
authored
test: Add test for get_baggage with DSN (#5441)
For now just testing what CI says about this test
1 parent 1476ff0 commit 18081e7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/test_api.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
)
2323

2424
from sentry_sdk.client import Client, NonRecordingClient
25+
from tests.conftest import TestTransportWithOptions
2526

2627

2728
def test_get_current_span():
@@ -96,6 +97,21 @@ def test_baggage_with_tracing_enabled(sentry_init):
9697
assert re.match(expected_baggage_re, get_baggage())
9798

9899

100+
def test_baggage_with_dsn(sentry_init):
101+
sentry_init(
102+
dsn="http://97333d956c9e40989a0139756c121c34@sentry-x.sentry-y.s.c.local/976543210",
103+
traces_sample_rate=1.0,
104+
release="2.0.0",
105+
environment="dev",
106+
transport=TestTransportWithOptions,
107+
)
108+
with start_transaction() as transaction:
109+
expected_baggage_re = r"^sentry-trace_id={},sentry-sample_rand=0\.\d{{6}},sentry-environment=dev,sentry-release=2\.0\.0,sentry-public_key=97333d956c9e40989a0139756c121c34,sentry-sample_rate=1\.0,sentry-sampled={}$".format(
110+
transaction.trace_id, "true" if transaction.sampled else "false"
111+
)
112+
assert re.match(expected_baggage_re, get_baggage())
113+
114+
99115
def test_continue_trace(sentry_init):
100116
sentry_init()
101117

0 commit comments

Comments
 (0)