Repository navigation
test(otel): [Sample Tests 4] Add a smoke test for the built agent - #6269
Open
runningcode wants to merge 1 commit into
Open
runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
runningcode
marked this pull request as ready for review
October 15, 2026 13:47
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
October 15, 2026 13:47
4 of 9 tasks
The agent had no tests; only the sample system tests exercised it. The test launches a JDK-only app in a child JVM with the agent attached and asserts that an incoming request reaches MockSentryServer as an http.server transaction from the agent SDK. The app runs in a child JVM so the test's own JVM stays uninstrumented. Otherwise the agent would turn the test's HTTP calls and the mock server into spans. The agent jar is wired as a test input, so the test reruns whenever the jar changes. Adding Kotlin for the test enrolls the module in API validation, hence the new API dump. 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/shared-envelope-matchers
branch
from
October 15, 2026 14:23
47c6edc to
cf186ed
Compare
📲 Install BuildsAndroid
|
This was referenced Oct 20, 2026
Draft
Draft
Draft
This was referenced Oct 20, 2026
Draft
Draft
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
AgentSmokeTest, the first test insentry-opentelemetry-agent. It:HelloServerin a child JVM with the built agent attached (-javaagent);http.servertransaction with SDK namesentry.java.opentelemetry.agentreachesMockSentryServer.The test task gets the agent jar through a
CommandLineArgumentProviderwith an@InputFile. So the task depends onshadowJarand reruns whenever the jar changes. The currentsystemTestconvention only tracks a hardcoded path.Why a child JVM: attaching the agent to the Gradle test JVM would also instrument the test itself:
sentry-trace/baggageheaders that the distributed-tracing tests set;MockSentryServer. Agent 2.29 instrumentscom.sun.net.httpserver, so every envelope POST would become a transaction that gets posted again.Adding Kotlin for the test enrolls the module in API validation, hence the new
.apifile listingAgentMarker. Every sibling OTel module with Kotlin already has one.💡 Motivation and Context
The agent had no in-module tests. Only three samples × two auto-init modes covered it, in a non-blocking CI job. This test catches a broken agent jar (manifest, relocation, SDK name, instrumentation loading) in
:sentry-opentelemetry:sentry-opentelemetry-agent:test.It also proves the child-JVM approach that the agent samples' tests will use when they move into modules. It costs about 6.5s.
💚 How did you test it?
system-out.:sentry-opentelemetry:sentry-opentelemetry-agent:checkpasses.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Move the launcher into
sentry-test-supportand run a Spring Boot fixture under the agent withSENTRY_AUTO_INIT=trueandfalse. Then port the agent samples' tests: Boot 2/3/4 × auto-init on/off.#skip-changelog