Documentation
¶
Overview ¶
Package drivertest provides a public conformance suite that any azync storage driver can run against its own driver.Store to prove it honors the backend-agnostic contract. Third-party driver authors wire their backend into RunConformance and get the same behavioral coverage the first-party PostgreSQL driver is held to.
The suite is black-box: it drives a Store only through the exported contract, never reaching into backend internals. It uses real wall-clock durations (a short lease plus a sleep for reaper tests, a far-future run_at for scheduling) so it is correct against any backend clock without a controllable clock.
Index ¶
- func RunChangeNotifierConformance(t *testing.T, newStore func(t *testing.T) driver.Store)
- func RunConformance(t *testing.T, newStore func(t *testing.T) driver.Store)
- func RunDAGConformance(t *testing.T, newStore func(t *testing.T) driver.Store)
- func RunWorkflowConformance(t *testing.T, newStore func(t *testing.T) driver.Store)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunChangeNotifierConformance ¶ added in v0.0.8
RunChangeNotifierConformance exercises the optional driver.ChangeNotifier capability against the Store returned by newStore. Stores without the capability skip the suite; a poll-only store (nil channel, nil error) skips too. The contract is best-effort and at-most-once with in-band resets, so every assertion drains the stream until a predicate matches instead of expecting exact sequences — extra hints, resets and unrelated activity on a shared backend are all legal.
func RunConformance ¶
RunConformance exercises the observable driver.Store contract against the Store returned by newStore. newStore is called once; every subtest shares that Store and stays independent by using unique kind and subscriber names, so a backend need not reset between subtests (they must not assume an empty store).
func RunDAGConformance ¶
RunDAGConformance exercises the observable driver.DAGStore contract against the Store returned by newStore, skipping cleanly when the store does not implement the capability. newStore is called once; every subtest shares that Store and stays independent by using unique workflow names and kinds, so a backend need not reset between subtests.
The scheduler methods are set-based across the whole store, so subtests assert on the states of their own workflow's tasks (through DAGTasks and GetDAG), never on the global counts those methods return.
func RunWorkflowConformance ¶
RunWorkflowConformance exercises the observable driver.WorkflowStore contract against the Store returned by newStore, skipping cleanly when the store does not implement the capability. newStore is called once; every subtest stays independent by using unique workflow names, so a backend need not reset between subtests.
Types ¶
This section is empty.