Documentation
¶
Overview ¶
Package fixtures reads the declared coordinate of this repo's published test-fixture modules, so tests pin the version the tree carries instead of a literal that has to be edited on every bump.
IDENTICAL COPY in cli/tests/fixtures/fixtures.go and opm-operator/test/fixtures/fixtures.go. The workspace root `task fixtures:lint` fails when the two drift; edit both.
A fixture lives at <this dir>/modules/<name>/ and its identity package (identity/identity.cue) is the single source of ModulePath and Version. The identity package is import-free by design, so loading it needs no registry and no CUE_REGISTRY mapping. hack/fixtures.sh reads the same two fields with `cue eval ./identity`; this is the Go spelling of that read.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Coordinate ¶
type Coordinate struct {
// ModulePath is the major-suffixed CUE module path, e.g.
// testing.opmodel.dev/modules/operator/hello@v0.
ModulePath string
// Version is the bare SemVer, e.g. 0.0.6.
Version string
}
Coordinate is a fixture's declared module path and bare SemVer version.
func Load ¶
func Load(name string) (Coordinate, error)
Load reads the coordinate of the fixture module <Dir()>/<name>.
func Must ¶
func Must(t Failer, name string) Coordinate
Must is Load for tests: a fixture that cannot be read fails the test.
func (Coordinate) Tag ¶
func (c Coordinate) Tag() string
Tag is the registry tag for the version: "v" + Version.