Help us shape the future of Go! Take the 2026 Go Developer Survey

layoutfixture

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package layoutfixture reads the expected-*-status.yaml fixtures under test/fixtures/layout-corpus.

It exists because those fixtures are asserted from two packages that cannot share a test helper: internal/git pins the half a refusal produces (GitPathAccepted), and internal/controller pins the half the controller projects from it (LayoutResolved, Stalled). A fixture parser copied into both would be two things that must agree about a file format, which is the drift the fixtures exist to prevent.

Index

Constants

View Source
const Root = "../../test/fixtures/layout-corpus"

Root is test/fixtures/layout-corpus as reached from a package directory two levels below the repository root (internal/git, internal/controller). The fixtures are read in place rather than copied into a testdata directory: a copy would drift from the documents it illustrates, and the drift would be invisible in review.

Variables

This section is empty.

Functions

func Path

func Path(elem ...string) string

Path joins a fixture path onto Root.

Types

type Condition

type Condition struct {
	Type    string `json:"type"`
	Status  string `json:"status"`
	Reason  string `json:"reason"`
	Message string `json:"message"`
}

Condition is one expected condition in a fixture.

func ReadCondition

func ReadCondition(path, conditionType string) (Condition, error)

ReadCondition returns the named condition from a status fixture. A missing condition is an error rather than a zero value: a test asking for one is asserting that the fixture makes that claim, and a silently absent claim is exactly what would let the fixture rot.

Jump to

Keyboard shortcuts

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