Documentation
¶
Overview ¶
Package store provides shared test helpers for store driver tests.
Index ¶
- func NewIncomingInviteFixture() *store.IncomingInvite
- func NewIncomingShareFixture() *store.IncomingShare
- func NewOutgoingInviteFixture() *store.OutgoingInvite
- func NewOutgoingShareFixture() *store.OutgoingShare
- func OpenDriver(t *testing.T, cfg *store.DriverConfig) store.Driver
- func RunDriverTests(t *testing.T, driverName string, cfg *store.DriverConfig)
- func TempDataDir(t *testing.T, _ string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewIncomingInviteFixture ¶
func NewIncomingInviteFixture() *store.IncomingInvite
NewIncomingInviteFixture creates a test incoming invite.
func NewIncomingShareFixture ¶
func NewIncomingShareFixture() *store.IncomingShare
NewIncomingShareFixture creates a test incoming share.
func NewOutgoingInviteFixture ¶
func NewOutgoingInviteFixture() *store.OutgoingInvite
NewOutgoingInviteFixture creates a test outgoing invite.
func NewOutgoingShareFixture ¶
func NewOutgoingShareFixture() *store.OutgoingShare
NewOutgoingShareFixture creates a test outgoing share.
func OpenDriver ¶
OpenDriver constructs a store driver from cfg and initializes it, failing the test on any error. The caller owns the returned driver and is responsible for closing it. OpenDriver intentionally does not register a close with t.Cleanup so that close/reopen durability tests can manage the driver lifecycle explicitly (open, close, reopen from the same cfg).
func RunDriverTests ¶
func RunDriverTests(t *testing.T, driverName string, cfg *store.DriverConfig)
RunDriverTests runs the standard test suite against a driver. All four persistence surfaces are required: OutgoingShareStore, IncomingShareStore, OutgoingInviteStore, and IncomingInviteStore.
Each subtest creates and closes its own fresh driver in a subdirectory of cfg.DataDir, so no store state leaks between siblings. A preflight driver is also created from the original cfg to ensure on-disk artifacts (e.g. ocm.db, mirror/) appear under cfg.DataDir for callers that check for them after this function returns.
Types ¶
This section is empty.