Skip to content

test(spring-boot): [Sample Tests 13] Move the Boot 2 sample's tests into the module - #6299

Draft
runningcode wants to merge 2 commits into
no/boot4-kafka-testfrom
no/boot2-integration-test
Draft

runningcode wants to merge 2 commits into
no/boot4-kafka-testfrom
no/boot2-integration-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Adds an integrationTest suite to sentry-spring-boot, modeled on the jakarta one. It ports these Boot 2 sample tests and deletes them from the sample:

  • Person
  • DistributedTracing
  • Todo
  • Cache
  • Metrics

Changes from the jakarta suite, because Spring Boot 2 differs:

  • No RestClient (Spring 5):
    • The tracing controller forwards through RestTemplate.
    • Todo covers RestTemplate, WebClient and OkHttp.
  • Reactor 3.4 has no automatic context propagation: WebClient is called on the request thread, as in the Boot 2 sample.
  • @LocalServerPort moved packages within Boot 2: the Todo test reads the port from TestRestTemplate's root URI instead, so the suite also compiles on Boot 2.4.
  • Kotlin 1.8 target, no kotlin-spring: classes stay open, as in jakarta.

Person test: this is the jakarta version, so it also checks the logged error and a span's feature flag, which the Boot 2 sample never asserted. Both pass on Boot 2.4 and 2.7.

Matrix: the Spring Boot 2 matrix now runs the suite on every version from 2.4 to 2.7.

Sample on old Boot versions: below 2.7, the sample's build excludes its remaining GraphQL and Kafka tests, leaving its systemTest with nothing to run. Gradle fails a test task that matches no tests, so isFailOnNoMatchingTests is now off in that case. The next PR removes this task along with the rest of the sample's system-test setup.

After a coverage audit against the sample's tests:

💡 Motivation and Context

This fans the Spring Boot 3 pilot out to Boot 2. The suite runs 16 tests.

💚 How did you test it?

  • All 16 tests pass on Spring Boot 2.7.18.
  • They also pass with the catalog set to 2.4.13, the matrix's oldest version.
  • Expecting the wrong cache span makes the evict test fail.
  • With GraphQL and Kafka excluded, the sample's systemTest passes with no tests.
  • :sentry-spring-boot:check passes.

📝 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

Port the Boot 2 sample's GraphQL and Kafka tests, which only run on Boot 2.7 and later. Then retire the sample from the runner and CI.

#skip-changelog

@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

This was referenced Oct 20, 2026
runningcode and others added 2 commits October 21, 2026 13:22
Adds an integrationTest suite to sentry-spring-boot that mirrors the
jakarta one and ports the Boot 2 sample's Person, DistributedTracing,
Todo, Cache and Metrics tests to it. Spring Boot 2 has no RestClient,
so the tracing forwards through RestTemplate and Todo covers three
clients, and WebClient is called on the request thread because Reactor
3.4 lacks automatic context propagation. The Person test is the jakarta
one, which also checks the logged error and a span's feature flag that
the Boot 2 sample never asserted.

The Spring Boot 2 matrix runs the suite from 2.4 to 2.7. Below 2.7 the
sample's remaining GraphQL and Kafka tests are excluded, so its
systemTest no longer fails on finding none.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/boot2-integration-test branch from b00abe3 to 87fb9af Compare October 21, 2026 11:27

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