testing

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package testing provides test helpers for database tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateUUID

func GenerateUUID() string

GenerateUUID returns a new UUID string for testing.

func SetupTestDB

func SetupTestDB(t *testing.T) *sql.DB

SetupTestDB creates an in-memory SQLite database for testing and runs all migrations.

func TeardownTestDB

func TeardownTestDB(t *testing.T, db *sql.DB)

TeardownTestDB closes the test database connection.

Types

type TestData

type TestData struct {
	Config     *models.Config
	Deployment *models.Deployment
	Execution  *models.Execution
}

TestData holds seeded test data for use in tests.

func SeedTestData

func SeedTestData(t *testing.T, db *sql.DB) *TestData

SeedTestData inserts sample test data into the database.

Jump to

Keyboard shortcuts

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