Documentation
¶
Index ¶
- Constants
- Variables
- type ColumnInfo
- type PortAllocator
- type SchemaCache
- type TestSuite
- func (s *TestSuite) CleanupSharedInfrastructure(ctx context.Context) error
- func (s *TestSuite) DiscoverServices() error
- func (s *TestSuite) FindInitScript() string
- func (s *TestSuite) RunTest(ctx context.Context, specPath string) error
- func (s *TestSuite) SetupSharedInfrastructure(ctx context.Context) error
Constants ¶
const ( // PublishedProxyImageRepo is the multi-arch image published by release CI // from Dockerfile.linespec. Protocol proxy sidecars run it. PublishedProxyImageRepo = "ghcr.io/livecodelife/linespec" // LocalProxyImage is the tag `linespec build` writes locally. A developer // working in a source checkout expects their freshly built proxy code to // be what runs, so its presence beats the published default. LocalProxyImage = "linespec:latest" )
Variables ¶
var DefaultPortAllocator = NewPortAllocator(10000, 65535)
DefaultPortAllocator is a package-level default allocator Used when no custom allocator is provided
Functions ¶
This section is empty.
Types ¶
type ColumnInfo ¶
type ColumnInfo struct {
Field string `json:"Field"`
Type string `json:"Type"`
Collation sql.NullString `json:"Collation"`
Null string `json:"Null"`
Key string `json:"Key"`
Default sql.NullString `json:"Default"`
Extra string `json:"Extra"`
Privileges string `json:"Privileges"`
Comment string `json:"Comment"`
}
ColumnInfo represents a single column from SHOW FULL FIELDS
type PortAllocator ¶
type PortAllocator struct {
// contains filtered or unexported fields
}
PortAllocator manages dynamic port allocation for test containers to avoid port conflicts when running multiple tests in parallel
func NewPortAllocator ¶
func NewPortAllocator(minPort, maxPort int) *PortAllocator
NewPortAllocator creates a new port allocator with the given port range If minPort and maxPort are 0, uses default range 10000-65535
func (*PortAllocator) Allocate ¶
func (pa *PortAllocator) Allocate() (int, error)
Allocate finds an available port and marks it as allocated Returns the port number or an error if no ports are available
func (*PortAllocator) AllocateMany ¶
func (pa *PortAllocator) AllocateMany(count int) ([]int, error)
AllocateMany allocates multiple ports atomically Returns the allocated ports or an error if not enough ports are available
func (*PortAllocator) Release ¶
func (pa *PortAllocator) Release(port int)
Release marks a port as no longer allocated
type SchemaCache ¶
type SchemaCache map[string][]ColumnInfo
SchemaCache represents the cached schema for tables
type TestSuite ¶
type TestSuite struct {
// contains filtered or unexported fields
}
func NewTestSuite ¶
func (*TestSuite) CleanupSharedInfrastructure ¶
CleanupSharedInfrastructure tears down the suite's shared containers and network. It returns the network removal error (after retrying) instead of discarding it: a network left behind by a failed run has active endpoints from containers that outlived their run, so a plain `docker network rm` fails — and silently swallowing that error let the *next* run's CreateNetwork fail with a confusing "network with name ... already exists", masking the original problem. Callers that treat this as best-effort (e.g. opportunistic cleanup before a fresh setup) may ignore the returned error, since the underlying failure is always logged here regardless.
func (*TestSuite) DiscoverServices ¶
DiscoverServices searches for services with .linespec.yml configuration files in the current directory and subdirectories (up to 2 levels deep for performance)
func (*TestSuite) FindInitScript ¶
FindInitScript returns the init SQL path for the first MySQL service that has database.init_script explicitly configured in its .linespec.yml.