Repository navigation
Commit be877be
test(spring-boot): [Sample Tests 7] Move the Boot 3 tracing and HTTP client tests (#6293)
* test(spring-boot): Move the Boot 3 tracing and HTTP client tests into the module
Ports the jakarta sample's DistributedTracingSystemTest and
TodoSystemTest to the integrationTest suite. The app calls itself on
its random port instead of a hardcoded localhost:8080, and serves the
todo the sample fetched from jsonplaceholder.typicode.com, so the tests
no longer need the internet.
Adds MockSentryServer.assertNoEnvelope for the unsampled case. A flush
can't prove an absence because the server may finish its transaction
after the client already has the response, so it watches for a short
window instead of the old 10s sleep.
The suite declares context-propagation explicitly: without it Reactor
can't carry the Sentry scope to the WebClient's thread. The sample only
had it because Spring GraphQL pulls it in.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(spring-boot): Tighten the Boot 3 tracing checks and use a plain test client
The unsampled-trace test now sends a request with an id of its own and
rejects any transaction for it, whatever its trace, so a mishandled
header that starts a new trace fails it. The sampled test checks that
transactions carry their request, which that relies on. The sample_rand
and deferred-sampling tests also check the envelope header's trace ID,
as the sample's tests did.
That check showed that the context's TestRestTemplate, built from the
RestTemplateBuilder Sentry customizes, added trace headers of its own
to the requests the tests sent. The suite now uses one built outside the
context.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>1 parent aa51872 commit be877be
11 files changed
Lines changed: 363 additions & 277 deletions
File tree
- sentry-samples/sentry-samples-spring-boot-jakarta/src/test/kotlin/io/sentry/systemtest
- sentry-spring-boot-jakarta
- src/integrationTest/kotlin/io/sentry/spring/boot/jakarta/integrationtest
- sentry-test-support/src
- main/kotlin/io/sentry/test
- test/kotlin/io/sentry/test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
183 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
184 | 189 | | |
185 | 190 | | |
| 191 | + | |
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
189 | 195 | | |
| 196 | + | |
190 | 197 | | |
191 | 198 | | |
192 | 199 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments