Skip to content

test(spring-boot): [Sample Tests 10] Move the Boot 3 Kafka test into the module - #6296

Merged
runningcode merged 2 commits into
mainfrom
no/boot-jakarta-kafka-test
Oct 23, 2026
Merged

runningcode merged 2 commits into
mainfrom
no/boot-jakarta-kafka-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Ports the jakarta sample's KafkaQueueSystemTest to the integrationTest suite in sentry-spring-boot-jakarta. That was the sample's last system test, so this PR also takes the sample off the system-test runner and CI.

Kafka tests. The suite gets an embedded KRaft broker from spring-kafka-test. It runs in the test JVM, so no Docker or Redpanda is needed. The sample's five tests become two that keep every assertion:

  • Producer side: the request that publishes has a queue.publish span.
  • Consumer side: the listener's queue.process transaction continues the producer's trace.
  • Both sides: carry messaging.system=kafka and messaging.destination.name=sentry-topic.

Each message is tied to its producer transaction by the request's query string, and to its consumer transaction by trace ID. The tests still pass on a shared mock server even if a late envelope arrives from another test.

Broker lifecycle. @EmbeddedKafka on the shared base class makes the broker part of the single application context. It starts before the app's listener connects and stops after it. An earlier version started the broker by hand, and that left KafkaStorageException noise at shutdown.

Catalog. spring-kafka 3 and the new spring-kafka-test now share a springKafka3 version, so the broker always matches the client.

Jakarta sample retired from system tests:

  • Removes the sample's systemTest task, the io.sentry.systemtest plugin, its test dependencies and its last test files. The app code stays as an example.
  • Removes the sample from the runner's module lists, including the Kafka ones.
  • Removes it from the backend workflow. Its base matrix row is now sentry-samples-spring-boot.
  • Removes the sample's build step and test step from the Spring Boot 3 matrix, which keeps running the module's integration suites.

Without these removals, the sample's systemTest would have no tests left. Gradle fails a test task that matches none, so the blocking matrix would break.

💡 Motivation and Context

This finishes the Spring Boot 3 pilot: everything the jakarta sample's system tests checked now runs in-module.

  • Suite size: 29 tests across 8 classes.
  • Speed: about 14s of Gradle time, including the Spring and broker startup. For comparison, the first 21 ported tests took about 3m49s through the Python runner.

The suites aren't part of check; the Spring Boot 3 matrix runs them.

💚 How did you test it?

  • All 29 suite tests pass on Spring Boot 3.5.0.
  • They also pass with the catalog set to 3.2.12, the matrix's oldest version.
  • Expecting the wrong topic on the consumer side makes that test fail.
  • The slimmed sample still builds.
  • :sentry-spring-boot-jakarta: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

  1. Fan the same approach out to Boot 4 and Boot 2.

#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.1 (1) release

⚙️ sentry-android Build Distribution Settings

This was referenced Oct 20, 2026
@runningcode
runningcode force-pushed the no/boot-jakarta-graphql-test branch 2 times, most recently from 5379114 to 429aa76 Compare October 21, 2026 11:27
@runningcode
runningcode force-pushed the no/boot-jakarta-kafka-test branch 2 times, most recently from 1685dba to 49f143f Compare October 22, 2026 12:40
@runningcode
runningcode force-pushed the no/boot-jakarta-graphql-test branch 2 times, most recently from 3c3957f to 830cd05 Compare October 22, 2026 13:31
@runningcode
runningcode force-pushed the no/boot-jakarta-kafka-test branch 2 times, most recently from 5d679cd to d6694c0 Compare October 22, 2026 14:02
@runningcode
runningcode marked this pull request as ready for review October 22, 2026 14:18
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Oct 22, 2026
@runningcode
runningcode force-pushed the no/boot-jakarta-kafka-test branch from d6694c0 to fbeadbc Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/boot-jakarta-graphql-test branch from 3269abc to 87dd655 Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/boot-jakarta-kafka-test branch from fbeadbc to bedbe69 Compare October 23, 2026 08:24
@runningcode
runningcode force-pushed the no/boot-jakarta-graphql-test branch from 87dd655 to daf0729 Compare October 23, 2026 08:24
@runningcode
runningcode force-pushed the no/boot-jakarta-kafka-test branch from bedbe69 to a60ceb3 Compare October 23, 2026 08:58
@runningcode
runningcode force-pushed the no/boot-jakarta-graphql-test branch 2 times, most recently from 9882327 to d003698 Compare October 23, 2026 09:35
@runningcode
runningcode force-pushed the no/boot-jakarta-kafka-test branch from a60ceb3 to accabe3 Compare October 23, 2026 09:35
Base automatically changed from no/boot-jakarta-graphql-test to main October 23, 2026 09:59
Ports the jakarta sample's KafkaQueueSystemTest to the integrationTest
suite with an embedded KRaft broker, so no Docker is needed. The five
sample tests become two that keep every assertion: the publishing
request's queue.publish span, and a queue.process transaction that
continues the producer's trace. Both check the messaging attributes.

The broker is declared with @embeddedkafka on the shared base class so
it belongs to the one application context: it starts before the app's
listener connects and stops after it.

The jakarta sample has no system tests left, so it comes off the
system-test runner, the backend workflow and the Spring Boot 3 matrix,
which keeps running the module's integration suites.

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/boot-jakarta-kafka-test branch from accabe3 to a18850d Compare October 23, 2026 10:27
@runningcode
runningcode enabled auto-merge (squash) October 23, 2026 10:43
@runningcode
runningcode merged commit 449c56d into main Oct 23, 2026
68 checks passed
@runningcode
runningcode deleted the no/boot-jakarta-kafka-test branch October 23, 2026 10:52
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