Repository navigation
test(otel): [Sample Tests 5] Test a Spring Boot app under the agent - #6271
Draft
runningcode wants to merge 1 commit into
Draft
runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
This was referenced Oct 15, 2026
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-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
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
This branch has not been deployed
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: the suite is wired intocheckfor now. Whether these suites run incheckor in a dedicated job gets decided after the Spring Boot pilot.💡 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