Skip to content

Parameterize the conformance TCK by window; run it from JDBI - #9

Merged
wolpert merged 1 commit into
mainfrom
tck-window-parameterization
Jul 19, 2026
Merged

Parameterize the conformance TCK by window; run it from JDBI#9
wolpert merged 1 commit into
mainfrom
tck-window-parameterization

Conversation

@wolpert

@wolpert wolpert commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

Make the velocity-testkit conformance TCK reusable by any backend regardless of window type,
so every velocity-backend-* runs the same shared scenarios rather than bespoke tests (ADR 0004).
This is the follow-up flagged in the JDBI PR — and it unblocks velocity-backend-redis (sliding),
which now reuses the identical harness with sliding windows.

What changed

  • Parameterized the window-agnostic scenarios (Count/Sum/Distinct/PurgeStoreScenarios): the
    window(s) they exercise are now constructor parameters instead of a hardcoded sliding window.
    CountStoreScenarios also takes a second, distinct window for its apply-cardinality check. The
    assertions, expected values, and logic are otherwise byte-for-byte unchanged — a faithful refactor
    (the change-validator confirmed no assertion was weakened).
  • InMemoryVelocityBackendTck injects sliding windows — its coverage is unchanged.
  • velocity-backend-jdbi now runs the shared Count/Sum/Distinct/Purge scenarios with
    tumbling windows — including the shared concurrentApplyIsAtomic (acceptance Bump actions/setup-java from 5.5.0 to 5.6.0 in the gh-actions group #1) against real
    Postgres — alongside Tumbling/Seed/Capability. Deleted the bespoke JdbiAggregationTest and
    JdbiConcurrencyTest, now superseded.
  • Closed the apply-side gap the deletion exposed (the reviewer's one non-blocking note): added two
    shared scenarios to CapabilityConformanceScenarios — applying to an unsupported window yields
    a distinguishable FAILED (never a silent APPLIED; ADR 0009), and a mixed supported +
    unsupported apply fails only the unsupported window (FR-34, per-feature partial outcome). Both run
    on the in-memory backend and real Postgres, so every backend now verifies apply-side behavior too.

Result

  • velocity-testkit: 50 tests, 0 skipped. velocity-backend-jdbi: 29 tests against real
    Postgres, 0 skipped. ./gradlew build green across all modules (gate 80/70).

Review

change-validator agent: VERDICT APPROVE — verified the parameterization is faithful (assertions
intact), both modules green, and the shared scenarios genuinely run unskipped against real Postgres.
The two apply-side scenarios were added after its review to close the single gap it identified.

Follow-up (minor)

The JDBI DataSource constructor is no longer directly exercised (the test harness builds the backend
via the Jdbi constructor) — a trivial delegating ctor; worth a one-line test later.

🤖 Generated with Claude Code

Make the velocity-testkit conformance TCK reusable by any backend regardless of
window type, so every velocity-backend-* runs the SAME shared scenarios instead of
bespoke tests (ADR 0004). Unblocks velocity-backend-redis (sliding) reusing the
identical harness.

- Parameterize the window-agnostic scenarios (Count/Sum/Distinct/PurgeStoreScenarios):
  the window(s) they exercise are now constructor parameters instead of a hardcoded
  sliding window. CountStoreScenarios takes a second distinct window for its apply-
  cardinality check. Assertions/values are otherwise unchanged (faithful refactor).
- InMemoryVelocityBackendTck injects sliding windows (coverage unchanged).
- velocity-backend-jdbi: JdbiConformanceTckTest now runs the SHARED Count/Sum/Distinct/
  Purge scenarios with TUMBLING windows — including the shared concurrentApplyIsAtomic
  (acceptance #1) against real Postgres — plus Tumbling/Seed/Capability. Deleted the
  bespoke JdbiAggregationTest and JdbiConcurrencyTest (now superseded by the shared
  scenarios).
- Close the apply-side gap the deletion exposed: added two SHARED scenarios to
  CapabilityConformanceScenarios — apply to an unsupported window -> distinguishable
  FAILED (never a silent APPLIED; ADR 0009), and a mixed supported+unsupported apply
  fails only the unsupported window (FR-34). Both run on InMemory and real Postgres.

velocity-testkit 50 tests, velocity-backend-jdbi 29 tests (real Postgres, 0 skipped),
whole project green (gate 80/70).

Reviewed by the change-validator agent: VERDICT APPROVE (no scenario assertion
weakened; shared scenarios genuinely running unskipped). The apply-side scenarios were
added after its review to close the one gap it flagged.

Follow-up (minor): the JDBI DataSource-constructor is no longer directly tested (the
harness uses the Jdbi constructor) — a trivial delegating ctor; add a small test later.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wolpert
wolpert merged commit 8942454 into main Jul 19, 2026
3 checks passed
@wolpert
wolpert deleted the tck-window-parameterization branch July 19, 2026 02:26
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