Documentation
¶
Overview ¶
Package contract provides public conformance tests for application-owned api.StoreProvider implementations.
Under Position D, Hydaelyn owns the storage contract verbs and their conformance tests. Applications own schema and implementation. The framework ships no reference StoreProvider implementation; contract/internal/inmemfake exists only to verify the suite itself. Application implementations should call RunStoreProviderContractTests from their own test packages.
See ADR-012, ADR-013, and the v0.8.0 storage contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunRecoveryContractTests ¶ added in v0.10.0
func RunRecoveryContractTests(t *testing.T, factory RecoveryProviderFactory)
RunRecoveryContractTests proves runtime-loss recovery through separate production Runner instances sharing one committed StoreProvider state.
func RunStoreProviderContractTests ¶
func RunStoreProviderContractTests(t *testing.T, factory ProviderFactory)
RunStoreProviderContractTests is the public contract gate for any api.StoreProvider implementation. External adapter authors call this from their own _test.go to verify their provider satisfies the framework contract.
v0.8.0 scope: 42 named subtests across CRUD, transactions, lease CAS, event ordering, resume tokens + outbox, replay determinism, capability self-consistency, and the multi-agent stores (HandoffStore / TeamStateStore / AgentInstanceStore — spec 07 §"New store contracts"). See docs/product-spec/v0.8.0/07-storage.md §"Contract test suite" for the authoritative list. See ADR-012 for the Position D stance. Application-owned StoreProvider implementations should run this suite. The framework ships no reference StoreProvider implementations.
Tests gated on optional capabilities call t.Skip when the provider self-declares the feature as unsupported via api.CapabilityReporter, so the suite never fails a conformant provider that simply does not opt in.
Types ¶
type ProviderFactory ¶
type ProviderFactory func(t *testing.T) (provider api.StoreProvider, cleanup func())
ProviderFactory builds a fresh StoreProvider for one test. The returned cleanup func runs after the test (via t.Cleanup).
type RecoveryProviderFactory ¶ added in v0.10.0
type RecoveryProviderFactory func(t *testing.T) ( open func() api.StoreProvider, cleanup func(), )
RecoveryProviderFactory creates an isolated backing store for one recovery contract case. Every call to open must return a provider handle exposing the same committed state. cleanup releases the backing store after the case.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
inmemfake
Package inmemfake provides a non-exported in-memory api.StoreProvider used solely by the framework's own contract-suite self-test in contract/contract_test.go.
|
Package inmemfake provides a non-exported in-memory api.StoreProvider used solely by the framework's own contract-suite self-test in contract/contract_test.go. |