Skip to content

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

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

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. integrationTests includes the tasks too.

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

… 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.
integrationTests includes them too.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.0 (1) release

⚙️ sentry-android Build Distribution Settings

runningcode and others added 2 commits October 20, 2026 21:02
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>

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant