Skip to content

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

Draft
runningcode wants to merge 3 commits into
no/boot-jakarta-graphql-testfrom
no/boot-jakarta-kafka-test
Draft

runningcode wants to merge 3 commits into
no/boot-jakarta-graphql-testfrom
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.

With this baseline, we can decide whether these suites run in check or in a separate job.

💚 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. Decide whether the in-module suites run in check or in a separate job.
  2. Fan the same approach out to Boot 4 and Boot 2.

#skip-changelog

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>
@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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Oct 20, 2026
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