Documentation
¶
Index ¶
- Variables
- type ColumnInfo
- type PortAllocator
- type Runnerdeprecated
- func NewRunner() (*Runner, error)deprecated
- type SchemaCache
- type TestSuite
- func (s *TestSuite) CleanupSharedInfrastructure(ctx context.Context)
- func (s *TestSuite) DiscoverServices() error
- func (s *TestSuite) FindInitScript() string
- func (s *TestSuite) ResetDatabase(ctx context.Context) error
- func (s *TestSuite) RunTest(ctx context.Context, specPath string) error
- func (s *TestSuite) SetupSharedInfrastructure(ctx context.Context) error
Constants ¶
This section is empty.
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 ¶ added in v1.4.0
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 ¶
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 looks for init.sql in discovered MySQL services