Skip to content

test(spring-boot): [Sample Tests 8] Move the Boot 3 cache, metrics and flag tests - #6294

Draft
runningcode wants to merge 2 commits into
no/boot-jakarta-tracing-todo-testfrom
no/boot-jakarta-cache-metrics-flags-test
Draft

runningcode wants to merge 2 commits into
no/boot-jakarta-tracing-todo-testfrom
no/boot-jakarta-cache-metrics-flags-test

Conversation

@runningcode

@runningcode runningcode commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

PR Stack (Sample Tests)


📜 Description

Ports the jakarta sample's CacheSystemTest, MetricsSystemTest and FeatureFlagSystemTest to the integrationTest suite in sentry-spring-boot-jakarta, and deletes them from the sample.

  • Cache: @CachePut, @Cacheable and @CacheEvict on a Caffeine-backed cache produce cache.put, cache.get and cache.evict spans.
    • Each span is checked on its own request's transaction. The sample accepted the span on any transaction.
  • Metrics: a counter, a gauge and a distribution each arrive with their values, and the counter carries the scope's attributes.
    • Each test flushes before waiting, because metrics are batched.
  • Feature flags: flags evaluated through OpenFeature land on the transaction, including a flag that evaluates to false.
    • A flag evaluated before an error lands on both the error and the transaction.
    • An unknown flag falls back to its default.
    • Flags come from the OpenFeature SDK's built-in InMemoryProvider, replacing the sample's 150-line hand-written provider.

The suite's Kotlin is now compiled with parameter names (javaParameters), the same way the Spring Boot Gradle plugin compiles apps. Without them, Spring can't resolve #id in a cache key, and the cache requests fail with "Null key returned for cache operation".

💡 Motivation and Context

This continues the Spring Boot 3 pilot.

  • Most-copied tests: CacheSystemTest has 11 identical copies and MetricsSystemTest has 14.
  • Only coverage of sentry-openfeature: FeatureFlagSystemTest is the only coverage that module has anywhere.

The suite's 21 tests run in about 5s.

💚 How did you test it?

  • All 21 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.
  • Breaking the gauge assertion makes it fail.
  • :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

Still to port from the jakarta sample:

  1. GraphQL (3 tests)
  2. Kafka

#skip-changelog

…sts into the module

Ports the jakarta sample's CacheSystemTest, MetricsSystemTest and
FeatureFlagSystemTest to the integrationTest suite. Feature flags use
the OpenFeature SDK's InMemoryProvider instead of the sample's
hand-written provider.

The suite's Kotlin is compiled with parameter names, as the Spring Boot
Gradle plugin does for apps; without them Spring can't resolve `#id` in
a cache key.

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

This was referenced Oct 20, 2026

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