Documentation
¶
Overview ¶
Package wiretest is test support for the entry points that run artifact operations: the CLI, workflow and custom-command steps, script step calls, and kind: step hooks.
A Fixture builds a real service over a real local directory repository in a temporary directory, pins the clock and the operation IDs, and installs the service through the artifact step's service seam. Every entry point then reaches the same wiring, and a test can compare what each one asked for and received against a baseline run of the shared implementation.
Index ¶
Constants ¶
const ( // OperationID is the operation ID every fixture service and artifact step generates. OperationID = "op-fixed" // Alias is the repository alias of the fixture's local directory repository. Alias = "dir" // Name and Version are the artifact the fixture source publishes. Name = "team/app" Version = "1.0.0" )
Pinned values every fixture uses, so independent runs produce byte-identical records.
Variables ¶
var PreparedAt = time.Date(2026, 10, 31, 12, 0, 0, 0, time.UTC)
PreparedAt is the pinned UTC preparation time.
Functions ¶
func Config ¶
func Config(root string) *schema.AtmosConfiguration
Config returns a configuration with one local directory repository rooted at root.
Types ¶
type Fixture ¶
type Fixture struct {
// Root is the repository root of the entry point under test.
Root string
// Source is a directory with the content to publish.
Source string
// Config is the Atmos configuration that declares the repository.
Config *schema.AtmosConfiguration
// Recorder records the publications that pass through the service seam.
Recorder *artifacttest.Recorder
// contains filtered or unexported fields
}
Fixture is a pinned artifact environment.
func New ¶
New creates the fixture and installs its service for artifact steps. The seams are restored when the test ends.
func (*Fixture) Baseline ¶
Baseline runs the fixture publication through the shared implementation, which is what the CLI runs, in a sibling repository. The result is normalized with Fixture.Normalize as if it came from the fixture's own repository.
func (*Fixture) Normalize ¶
func (f *Fixture) Normalize(op *artifact.OperationResult) artifact.OperationResult
Normalize rewrites the repository root of the fixture to a placeholder, so results from repositories rooted in different directories compare equal.
func (*Fixture) Params ¶
Params returns the parameters of the fixture publication. Every entry point is configured to publish exactly this.
func (*Fixture) StepFields ¶
StepFields returns the artifact step fields of the fixture publication, as authored in YAML.