Documentation
¶
Overview ¶
Package suiterun runs a declarative suite from a Go test binary. A project supplies its step definitions and cleanup handlers through Options and calls Main from TestMain and Run from a test; flag parsing, topology loading, image builds, selection, coverage and log capture are handled here. The framework's own suite and a suite in another repository that imports the framework as a module use the same entry points.
Index ¶
Constants ¶
const DefaultSuiteFile = "it-suite.yaml"
DefaultSuiteFile is the suite declaration read from Options.Dir when none is named.
Variables ¶
This section is empty.
Functions ¶
func FindWorkspaceRoot ¶
FindWorkspaceRoot returns the nearest directory at or above dir that holds a go.work file or a .git entry.
func Main ¶
Main parses the suite flags, prepares the process, runs the tests and exits. Call it from TestMain.
Types ¶
type Options ¶
type Options struct {
// Dir holds the suite file and is the root feature paths resolve against. It defaults to
// the working directory, which `go test` sets to the test package's directory.
Dir string
// SuiteFile names the suite declaration inside Dir. It defaults to DefaultSuiteFile.
SuiteFile string
// WorkspaceRoot is the project checkout. Relative policy trees and project files resolve
// against it, and files the framework itself owns fall back to its embedded copies. It
// defaults to the nearest ancestor of Dir that holds a go.work file or a .git entry.
WorkspaceRoot string
// Steps constructs the runner-isolated step definitions. It is required.
Steps func(topo *frameworkruntime.Topology, featureRoot string) (frameworkruntime.StepRegistrar, error)
// CleanupDeleters registers how each resource kind is deleted. It is optional.
CleanupDeleters func(reg *cleanup.Registry, topo *frameworkruntime.Topology)
}
Options describes one suite.