testutils

package
v0.3.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupPostgresTestData

func CleanupPostgresTestData(t *testing.T, db *gorm.DB)

CleanupPostgresTestData cleans up test data from the shared PostgreSQL database

func CleanupSharedMySQL

func CleanupSharedMySQL()

CleanupSharedMySQL terminates the shared MySQL container

func CleanupSharedPostgres

func CleanupSharedPostgres()

CleanupSharedPostgres terminates the shared PostgreSQL container

func CleanupTestData

func CleanupTestData(t *testing.T, db *gorm.DB)

CleanupTestData cleans up test data from the shared database

func GetSharedMySQLDB

func GetSharedMySQLDB(t *testing.T) (*gorm.DB, func())

GetSharedMySQLDB returns a connection to the shared MySQL database

func GetSharedMySQLDSN

func GetSharedMySQLDSN(t *testing.T) string

GetSharedMySQLDSN returns the DSN for the shared MySQL database

func GetSharedPostgresDB

func GetSharedPostgresDB(t *testing.T) (*gorm.DB, func())

GetSharedPostgresDB returns a connection to the shared PostgreSQL database

func GetSharedPostgresDSN

func GetSharedPostgresDSN(t *testing.T) string

GetSharedPostgresDSN returns the DSN for the shared PostgreSQL database

func SetupMySQLWithMigrations

func SetupMySQLWithMigrations(t *testing.T, spec *datastore.Spec) (*gorm.DB, func())

SetupMySQLWithMigrations returns a migrated MySQL database connection

func SetupPostgresWithMigrations

func SetupPostgresWithMigrations(t *testing.T, spec *datastore.Spec) (*gorm.DB, func())

SetupPostgresWithMigrations returns a migrated PostgreSQL database connection

func SetupSharedMySQL

func SetupSharedMySQL() error

SetupSharedMySQL initializes a shared MySQL container for all tests

func SetupSharedPostgres

func SetupSharedPostgres() error

SetupSharedPostgres initializes a shared PostgreSQL container for all tests

func TestMainHelper

func TestMainHelper(m *testing.M) int

TestMainHelper provides a helper function for package-level test setup

func TestMainPostgresHelper

func TestMainPostgresHelper(m *testing.M) int

TestMainPostgresHelper provides a helper function for package-level test setup with PostgreSQL

Types

This section is empty.

Jump to

Keyboard shortcuts

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