testkit

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package testkit opens the metadata store selected by DRIVESYNC_STORE. The default is sqlite. postgres starts one embedded Postgres per process and gives each test its own schema.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenEnginePair

func OpenEnginePair(t testing.TB) (EngineStore, EngineStore)

OpenEnginePair returns two stores on one database. SQLite shares a file. Postgres shares a schema, so each store is its own authority process view.

func OpenPublic

func OpenPublic(t testing.TB) *drivesync.MetaStore

OpenPublic opens the public metadata store for this test.

func Postgres

func Postgres() bool

Postgres reports whether DRIVESYNC_STORE selects Postgres.

Types

type EngineStore

type EngineStore interface {
	Transaction(context.Context, func(*engine.Metadata) error) error
	Close() error
}

EngineStore is the private metadata store tests share across backends.

func OpenEngine

func OpenEngine(t testing.TB) EngineStore

OpenEngine opens the engine store for this test and closes it on cleanup.

Jump to

Keyboard shortcuts

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