Skip to content

Commit d225dfd

Browse files
runningcodeclaude
andcommitted
test(spring-boot): Port the Boot 3 OTel agent sample's Person, tracing and Todo tests
The agent tests now start the fixture app once per test JVM and share it, because it takes seconds to start. Which mode initializes Sentry is a property of the test task, so the suite's task runs with the agent initializing it and a new integrationTestOtelAgentWithoutAutoInit task runs the same tests with the Spring Boot starter doing it. Gradle runs the two in parallel. The fixture gains the Person POST, distributed tracing and Todo endpoints, and the suite ports the agent sample's Person, DistributedTracing and Todo tests. Sentry exports the agent's spans in batches every 5 seconds, which can't be configured, so each test waits for the next batch and the negative tracing check waits past one. ChildJvmApp now copies the app's output into the test's as it arrives instead of printing it on close. The shared app is closed when the JVM exits, where its whole log would otherwise land on the console. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 552a663 commit d225dfd

18 files changed

Lines changed: 639 additions & 569 deletions

File tree

‎.github/workflows/spring-boot-3-matrix.yml‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ jobs:
8383
:sentry-spring-boot-jakarta:integrationTest \
8484
:sentry-spring-boot-jakarta:integrationTestWebflux \
8585
:sentry-spring-boot-jakarta:integrationTestOtelNoAgent \
86-
:sentry-spring-boot-jakarta:integrationTestOtelAgent
86+
:sentry-spring-boot-jakarta:integrationTestOtelAgent \
87+
:sentry-spring-boot-jakarta:integrationTestOtelAgentWithoutAutoInit
8788
8889
- name: Test sentry-samples-spring-boot-jakarta-opentelemetry agent init true
8990
run: |

‎build.gradle.kts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ tasks.register("integrationTests") {
247247
":sentry-spring-boot-jakarta:integrationTestWebflux",
248248
":sentry-spring-boot-jakarta:integrationTestOtelNoAgent",
249249
":sentry-spring-boot-jakarta:integrationTestOtelAgent",
250+
":sentry-spring-boot-jakarta:integrationTestOtelAgentWithoutAutoInit",
250251
":sentry-spring-boot-4:integrationTest",
251252
":sentry-spring-boot-4:integrationTestWebflux",
252253
":sentry-spring-boot-4:integrationTestOtelNoAgent",

‎sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/src/test/kotlin/io/sentry/systemtest/DistributedTracingSystemTest.kt‎

Lines changed: 0 additions & 197 deletions
This file was deleted.

‎sentry-samples/sentry-samples-spring-boot-jakarta-opentelemetry/src/test/kotlin/io/sentry/systemtest/PersonSystemTest.kt‎

Lines changed: 0 additions & 169 deletions
This file was deleted.

0 commit comments

Comments
 (0)