Documentation
¶
Overview ¶
Package storeconformance provides a shared conformance test suite for the port.SessionStore interface. Adapters (the in-memory default, the JSONL replay store, remote drivers, ...) call Run with a factory that constructs a fresh store, and the suite exercises only the port.SessionStore interface against sessions built through the session aggregate's public API.
Importing "testing" in a non-_test.go file is intentional here: this is a test-helper package whose sole purpose is to be imported by adapter tests, the conventional Go pattern for shared conformance suites (cf. testing/fstest and the sibling fsconformance/memconformance packages).
The suite pins the CONTRACT, not the implementation: snapshot encoding, durability across reopen, and file layout are adapter-internal and deliberately NOT asserted here. There is no separate self-test — the memstore run site IS the in-engine validation (memstore is the reference in-memory store; adding a second in-memory fake would only duplicate it).
Index ¶
- func Run(t *testing.T, newStore func(t *testing.T) port.SessionStore)
- func RunConditionalPrunable(t *testing.T, newStore func(t *testing.T) port.SessionStore)
- func RunMetadataPager(t *testing.T, newStore func(t *testing.T) port.SessionStore)
- func RunPrunable(t *testing.T, newStore func(t *testing.T) port.SessionStore)
- func RunSessionCreator(t *testing.T, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run executes the shared SessionStore conformance table against the store produced by newStore. newStore must return a fresh, isolated store each call.
func RunConditionalPrunable ¶
RunConditionalPrunable executes the atomic metadata-revalidation cleanup contract against stores that advertise port.ConditionalPrunableStore.
func RunMetadataPager ¶
RunMetadataPager executes the shared optional metadata-pager contract against every store that advertises port.SessionMetadataPager.
func RunPrunable ¶
RunPrunable executes the shared port.PrunableStore conformance table against the store produced by newStore (which must also implement port.PrunableStore — the suite fails fast otherwise). Like Run, it pins the MECHANISM only: List returns what was saved with sane ModifiedAt values, Delete removes and is idempotent. Retention POLICY (which ids are prunable, age thresholds, per-family caps) is the caller's business and is deliberately NOT asserted here.
func RunSessionCreator ¶
func RunSessionCreator(t *testing.T, newSharedStores func(t *testing.T) (port.SessionStore, port.SessionStore))
RunSessionCreator executes the optional atomic first-publication contract. newSharedStores must return two handles backed by the same authoritative storage so the concurrent case exercises backend, not process-local, exclusion.
Types ¶
This section is empty.