Skip to content

test(spring-boot): [Sample Tests 26] Move the Boot 2 OTel agent sample's tests - #6318

Open
runningcode wants to merge 3 commits into
no/boot4-otel-agent-integration-testfrom
no/boot2-otel-agent-integration-test
Open

runningcode wants to merge 3 commits into
no/boot4-otel-agent-integration-testfrom
no/boot2-otel-agent-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Moves sentry-samples-spring-boot-opentelemetry's tests into sentry-spring-boot. It adds the agent setup from #6315 and #6317: an agentFixture app, the integrationTestOtelAgent suite and the integrationTestOtelAgentWithoutAutoInit task.

The sample's tests are the Boot 3 agent sample's minus Cache and RestClient (Boot 2 has no RestClient). So the fixture and tests are #6316's, with the Boot 2 changes the other Boot 2 suites (#6299, #6314) already make:

  • Outgoing calls: RestTemplate instead of RestClient. WebClient is called on the request thread.
  • Version gate: GraphQL and Kafka compile and run only on Spring Boot 2.7 and later.

Kafka gets an app of its own. The shared app has to start on Boot versions without Kafka support. So the Kafka test starts its own broker (spring-kafka 2.8's, with ZooKeeper) and a second fixture app with the kafka profile. This is the agent version of the separate Kafka context in #6300 and #6314. AgentApp becomes a class for this, with the shared instance in its companion. The base class's app is the shared one unless a test overrides it.

The sample only checked the project query span's op. The full op and description check passes on Boot 2 too, as it does on 3 and 4.

With no system tests left, the sample comes off the runner, the backend workflow and the Spring Boot 2 matrix. The matrix now runs both agent tasks and no longer builds the agent separately.

This was the last sample with the agent. All three Boot lines now test the agent in both init modes.

After a coverage audit against the sample's tests:

💡 Motivation and Context

The Boot 2 agent flavor now runs in the module in both init modes. Each task runs 22 tests in about 112s, or 15 below Boot 2.7.

💚 How did you test it?

  • All 22 tests pass in both modes on Spring Boot 2.7.18.
  • With the catalog set to 2.4.13, the 15 tests without GraphQL or Kafka pass in both modes.
  • Expecting the wrong starter SDK name fails only the WithoutAutoInit task.
  • :sentry-spring-boot:check passes, and the sample still builds.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

The Spring WAR samples (sentry-spring, sentry-spring-jakarta, sentry-spring-7).

#skip-changelog

🤖 Generated with Claude Code

This was referenced Oct 20, 2026
@sentry

sentry Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.1 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode force-pushed the no/boot2-otel-agent-integration-test branch 2 times, most recently from 0ca29e4 to bd965ea Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/boot4-otel-agent-integration-test branch from 55007b3 to 82f52fb Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/boot2-otel-agent-integration-test branch from bd965ea to 905fa14 Compare October 23, 2026 08:24
@runningcode
runningcode force-pushed the no/boot4-otel-agent-integration-test branch 2 times, most recently from 512dc78 to 9339a3c Compare October 23, 2026 08:58
@runningcode
runningcode force-pushed the no/boot2-otel-agent-integration-test branch from 905fa14 to 454f6b5 Compare October 23, 2026 08:58
@runningcode
runningcode force-pushed the no/boot4-otel-agent-integration-test branch from 9339a3c to a8e9846 Compare October 23, 2026 09:35
@runningcode
runningcode force-pushed the no/boot2-otel-agent-integration-test branch 2 times, most recently from 1d1480d to d904f4c Compare October 23, 2026 11:51
@runningcode
runningcode force-pushed the no/boot4-otel-agent-integration-test branch 2 times, most recently from 65720b4 to 890c12d Compare October 23, 2026 12:48
@runningcode
runningcode force-pushed the no/boot2-otel-agent-integration-test branch from d904f4c to 16f848b Compare October 23, 2026 12:48
@runningcode
runningcode force-pushed the no/boot4-otel-agent-integration-test branch from 890c12d to 98681ee Compare October 23, 2026 13:02
@runningcode
runningcode force-pushed the no/boot2-otel-agent-integration-test branch 2 times, most recently from 395056a to adb7997 Compare October 23, 2026 13:53
@runningcode
runningcode force-pushed the no/boot4-otel-agent-integration-test branch from 98681ee to c678ae2 Compare October 23, 2026 13:53
… module

Adds the agent setup to sentry-spring-boot, as in the Boot 3 and 4
modules. The sample's tests were the Boot 3 agent sample's minus Cache
and RestClient, which Boot 2 doesn't have. GraphQL and Kafka are gated
on Boot 2.7, as in the other Boot 2 suites.

The shared app has to start on Boot versions without Kafka support, so
the Kafka test starts an app of its own with the kafka profile and an
in-JVM broker. AgentApp becomes a class for that, with the shared
instance in its companion.

The sample has no system tests left, so it comes off the system-test
runner, the backend workflow and the Spring Boot 2 matrix, which now
runs both agent tasks and no longer builds the agent separately.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…oot 2 agent

Ports the tracing and GraphQL checks to the Boot 2 agent suite, and
gives the app three minutes to start, as for Boot 3 and 4.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants