integrationtest

package
v11.3.24 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package integrationtest provides selection and completion enforcement for repository-owned, build-tagged integration suites.

Index

Constants

View Source
const (
	// ServicesEnv selects comma-separated integration services.
	ServicesEnv = "CHASSIS_INTEGRATION_SERVICES"
	// MarkerDirEnv is set by scripts/test-integration.sh. A selected suite only
	// writes its completion marker after its callback returns without failing or
	// skipping.
	MarkerDirEnv = "CHASSIS_INTEGRATION_MARKER_DIR"
)

Variables

This section is empty.

Functions

func CleanupDocker

func CleanupDocker(t *testing.T, name, service string)

CleanupDocker removes a suite-owned container and its attached anonymous volumes, preserving any primary test failure while making removal failure fail an otherwise successful owner.

func CleanupDockerImage

func CleanupDockerImage(t *testing.T, reference, service string)

CleanupDockerImage removes a suite-owned image and propagates removal failures using the same bounded cleanup contract as CleanupDocker.

func LoadPinnedImage

func LoadPinnedImage(t *testing.T, service string) string

LoadPinnedImage returns the immutable image reference registered for service. Selected live suites call this so missing or mutable image config is a hard failure, not a silent skip.

func RequireDocker

func RequireDocker(t *testing.T, service string)

RequireDocker hard-fails selected suites when Docker is unavailable or unhealthy. Selected live suites must not skip required service startup.

func RequireEnv

func RequireEnv(t *testing.T, names ...string) map[string]string

RequireEnv returns required endpoint/config values. It must be called inside Run so missing configuration for a selected service is a hard failure.

func Run

func Run(t *testing.T, service string, fn func(*testing.T))

Run skips only when service is not selected. For a selected service, fn must return successfully before the harness emits the marker required by the integration script. A selected fn that fails or calls Skip cannot create a false-green completion marker.

func WaitFor

func WaitFor(t *testing.T, timeout time.Duration, probe func() (bool, string))

WaitFor polls readiness with a bounded context and reports the last observed diagnostic on timeout.

Types

type Selection

type Selection struct {
	// contains filtered or unexported fields
}

Selection is an immutable set of explicitly selected service names.

func ParseSelection

func ParseSelection(raw string) (Selection, error)

ParseSelection parses the exact, comma-separated service selector contract. Empty input selects no services. Empty tokens, duplicates, invalid names, and the script-only "all" selector are rejected.

func (Selection) Includes

func (s Selection) Includes(service string) bool

Includes reports whether service was explicitly selected.

func (Selection) Services

func (s Selection) Services() []string

Services returns selected services in deterministic order.

Jump to

Keyboard shortcuts

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