…odule
Ports the Boot 2 sample's GraphQL and Kafka tests to the
integrationTest suite. Both need Spring Boot 2.7, while the Spring
Boot 2 matrix also covers 2.4 to 2.6, so below 2.7 the suite leaves out
their dependencies and sources.
That also keeps the broker off the shared base class: the Kafka test
runs its own application context under a kafka profile with
@embeddedkafka, and each context gets its own in-memory database. The
second context re-initializes the global SDK; the app reaches Sentry
through ScopesAdapter, so the other tests pass in either order.
The Boot 2 sample has no system tests left, so it comes off the
system-test runner, the backend workflow and the Spring Boot 2 matrix.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
PR Stack (Sample Tests)
main)📜 Description
Ports the Boot 2 sample's three GraphQL tests and its Kafka test to the
integrationTestsuite insentry-spring-boot. They were the sample's last system tests, so this PR also takes the Boot 2 sample off the system-test runner and CI.Gated on Spring Boot 2.7. Both features need Spring Boot 2.7, but the Spring Boot 2 matrix also covers 2.4 to 2.6. A
bootSupportsGraphqlAndKafkaflag reads the catalog's Boot 2 version, which the matrix patches. Below 2.7, the suite leaves out the GraphQL and Kafka dependencies and sources, as the sample did withexcludeGraphql/excludeKafka.Kafka runs its own context. The shared base class has to compile without
spring-kafka-teston Boot 2.4–2.6, so the broker can't live there as it does for Boot 3 and 4. Instead:KafkaIntegrationTestactivates akafkaprofile and declares its own@EmbeddedKafkabroker, which makes Spring start a second application context. The Kafka beans only exist under that profile.jdbc:p6spy:hsqldb:mem:${random.uuid}). A first attempt shared one: the second context'sschema.sqlfailed on the existing table, and its failed shutdown closed the global SDK, which broke every later test.ScopesAdapter, so this is transparent to the first context. I ran a forced order (main context → Kafka → main context) and all 11 tests passed.Catalog.
spring-kafka2 and the newspring-kafka-testnow share aspringKafka2version.Boot 2 sample retired from system tests:
isFailOnNoMatchingTestsfrom test(spring-boot): [Sample Tests 13] Move the Boot 2 sample's tests into the module #6299. The sample's main-source exclusions for Boot below 2.7 stay.sentry-samples-spring-boot-opentelemetry-noagenttakes its place.After a coverage audit against the sample's tests:
assigneeIdandcreatorIdchecks from test(spring-boot): [Sample Tests 9] Move the Boot 3 GraphQL tests into the module #6295.💡 Motivation and Context
With this, all three Spring Boot lines run their sample tests in-module:
💚 How did you test it?
:sentry-spring-boot:checkpasses.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
The remaining flavors: WebFlux, OTel without the agent, the agent suites for Boot 2 and 4, the Spring WAR samples, and the console and logging samples.
#skip-changelog