Skip to content

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

Merged
runningcode merged 1 commit into
mainfrom
no/boot-jakarta-cache-metrics-flags-test
Oct 23, 2026
Merged

runningcode merged 1 commit into
mainfrom
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

@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-tracing-todo-test branch from b122190 to 74b0fe9 Compare October 21, 2026 09:19
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch 2 times, most recently from 896122f to c59a493 Compare October 21, 2026 11:27
@runningcode
runningcode force-pushed the no/boot-jakarta-tracing-todo-test branch from 56c3fe9 to f5157ac Compare October 22, 2026 12:40
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from c59a493 to 9c1875a Compare October 22, 2026 12:40
@runningcode
runningcode force-pushed the no/boot-jakarta-tracing-todo-test branch from f5157ac to 838dcbf Compare October 22, 2026 13:31
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from 9c1875a to 47f46a0 Compare October 22, 2026 13:31
@runningcode
runningcode force-pushed the no/boot-jakarta-tracing-todo-test branch from 838dcbf to c742f0a Compare October 22, 2026 14:02
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from 47f46a0 to 55f949b Compare October 22, 2026 14:02
@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Oct 22, 2026
@runningcode
runningcode marked this pull request as ready for review October 22, 2026 14:17
@runningcode
runningcode force-pushed the no/boot-jakarta-tracing-todo-test branch from c742f0a to da63fd9 Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from 55f949b to 3c4da5a Compare October 22, 2026 16:02
@runningcode
runningcode force-pushed the no/boot-jakarta-tracing-todo-test branch from da63fd9 to f76055f Compare October 23, 2026 08:24
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from 3c4da5a to 57716e0 Compare October 23, 2026 08:24
Base automatically changed from no/boot-jakarta-tracing-todo-test to main October 23, 2026 08:49
…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>
@runningcode
runningcode force-pushed the no/boot-jakarta-cache-metrics-flags-test branch from 57716e0 to f7b8dbc Compare October 23, 2026 08:58
@runningcode
runningcode enabled auto-merge (squash) October 23, 2026 09:23
@runningcode
runningcode merged commit 4d96804 into main Oct 23, 2026
69 of 70 checks passed
@runningcode
runningcode deleted the no/boot-jakarta-cache-metrics-flags-test branch October 23, 2026 09:25
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