testdb

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package testdb spins up a migrated in-memory SQLite store for tests. It is the shared harness behind the drift/security fix acceptance tests, one migrated Store plus a minimal org→stack→env→tile seed so tests can exercise real store methods and DB constraints (unique indexes, FKs) instead of mocking them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(t testing.TB) *sqlite.Store

New returns a fresh migrated in-memory store. The DB is closed on test cleanup.

Types

type Seed

type Seed struct {
	Org   *repo.Org
	Stack *repo.Stack
	Env   *repo.Environment
	Tile  *repo.Tile
}

Seed is a minimal object graph: one org, stack, static env, and service tile.

func SeedStack

func SeedStack(t testing.TB, s *sqlite.Store, managed bool) Seed

SeedStack creates org→stack→env→tile so a test can attach domains/volumes to Tile without hand-building the FK chain each time. managed controls whether the stack is config-managed (ConfigManaged() true).

Jump to

Keyboard shortcuts

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