Repository navigation
test(otel): [Sample Tests 5] Test a Spring Boot app under the agent - #6271
Merged
Merged
Conversation
This was referenced Oct 15, 2026
runningcode
force-pushed
the
no/agent-smoke-test
branch
from
October 15, 2026 14:23
335ce27 to
38d8621
Compare
runningcode
force-pushed
the
no/agent-spring-boot-test
branch
from
October 15, 2026 14:23
12492f0 to
7cb3592
Compare
📲 Install BuildsAndroid
|
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
Draft
This was referenced Oct 20, 2026
Draft
Draft
Open
runningcode
force-pushed
the
no/agent-smoke-test
branch
from
October 21, 2026 09:19
38d8621 to
ae7fafb
Compare
runningcode
force-pushed
the
no/agent-spring-boot-test
branch
2 times, most recently
from
October 21, 2026 11:27
5e6b6d2 to
b6735fe
Compare
runningcode
force-pushed
the
no/agent-smoke-test
branch
from
October 21, 2026 11:27
ae7fafb to
7d9767f
Compare
runningcode
force-pushed
the
no/agent-spring-boot-test
branch
from
October 22, 2026 12:40
b6735fe to
dc154c2
Compare
runningcode
force-pushed
the
no/agent-spring-boot-test
branch
from
October 22, 2026 13:27
dc154c2 to
96b0caf
Compare
Runs a Spring Boot app with the built agent in a child JVM and checks that errors, the server transaction with OTel and Sentry API spans, and logs reach MockSentryServer. It runs once with the agent initializing Sentry and once with the Spring Boot starter doing it; the SDK name proves which path ran. The sample's auto-init=false CI variant shares task inputs with the true variant, so Gradle can skip it as up to date. The app has its own source set so it runs on an app-like classpath rather than the test's, which carries the agent's plain jar and would flip the auto-configuration conditions. The child-JVM launcher moves into sentry-test-support and the argument provider into build-logic, so both agent tests share them. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
runningcode
force-pushed
the
no/agent-spring-boot-test
branch
from
October 22, 2026 14:02
96b0caf to
c518635
Compare
runningcode
marked this pull request as ready for review
October 22, 2026 14:10
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
October 22, 2026 14:10
0xadam-brown
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Sample Tests)
main)📜 Description
Adds
OtelAgentPersonTestin a newintegrationTestOtelAgenttest suite insentry-spring-boot-jakarta. It runs a Spring Boot app with the built agent in a child JVM, requests an endpoint that fails, and checks what reachesMockSentryServer:http.servertransaction, with spans created through both the OTel API and the Sentry API;The test runs twice:
SENTRY_AUTO_INITtruesentry.java.opentelemetry.agentfalsesentry.java.spring-boot.jakartaDifferent SDK names show that each mode really takes its own init path.
How the pieces fit:
ChildJvmApp(sentry-test-support): the launcher, moved out ofAgentSmokeTest. Apps write their port to the file named byPORTFILE. Spring Boot'sWebServerPortFileWriteralready supports that, so the Boot app needs no custom code for it.ChildJvmTestArguments(build-logic): passes the agent jar and the app classpath to the test JVM as task inputs. It replaces the class that was defined inline in the agent module's build script.agentFixturesource set: the app has its own source set, so it runs on a classpath like a real app with the agent attached. The test classpath wouldn't work: it has mocks, Truth, and the agent's plain jar, whoseAgentMarkerwould flip the auto-configuration conditions.check. test(spring-boot): [Sample Tests 6] Move the Boot 3 Person test into the module #6292 adds it to the Spring Boot 3 matrix; until then, CI doesn't run it.💡 Motivation and Context
In the agent samples' CI, the
auto-init=falsevariant has the same task inputs as thetruevariant, so Gradle can skip it as up to date. This PR checks both modes in-module, at about 8s each. That unblocks moving the agent samples' tests into the Boot modules.The sample's
PersonSystemTeststays until the rest of the agent sample's tests move.💚 How did you test it?
:sentry-test-support:check,:sentry-opentelemetry:sentry-opentelemetry-agent:checkand:sentry-spring-boot-jakarta:checkpass.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog