Help us shape the future of Go! Take the 2026 Go Developer Survey

store

package
v1.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package store provides shared test helpers for store driver tests.

Index

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

func OpenDriver(t *testing.T, cfg *store.DriverConfig) store.Driver

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.

func TempDataDir

func TempDataDir(t *testing.T, _ string) string

TempDataDir creates an isolated temporary data directory for a store driver test via t.TempDir(). The pattern argument is ignored and kept for call-site compatibility; cleanup is managed by testing.T.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL