Documentation
¶
Overview ¶
Package manifesttest stops tests from running against manifests that were never rendered.
The deploy/*/rendered directories are embedded with go:embed, but they are gitignored output of the make *-manifests targets. On a fresh clone each one holds only its .gitignore placeholder, so the embedded filesystem is empty, and tests that read it fail with unrelated errors, crash the test binary, or pass without checking anything. `make test` renders every set first; plain `go test`, `go test -run` and IDE test runners do not.
A package whose tests read rendered manifests calls Main from TestMain, so it fails once, before any test runs, and names the make targets to run.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Gantry = Set{ Dir: "deploy/gantry/rendered", Target: "gantry-manifests", FS: gantrymanifests.Manifests, } Machina = Set{ Dir: "deploy/machina/rendered", Target: "machina-manifests", FS: machinamanifests.Manifests, } Net = Set{ Dir: "deploy/net/rendered", Target: "net-manifests", FS: netmanifests.Manifests, } TokenRefresher = Set{ Dir: "deploy/token-refresher/rendered", Target: "token-refresher-manifests", FS: tokenrefreshermanifests.Manifests, } UnboundedOperator = Set{ Dir: "deploy/unbounded-operator/rendered", Target: "unbounded-operator-manifests", FS: operatormanifests.Manifests, } )
The rendered sets that tests read.
Functions ¶
Types ¶
type Set ¶
type Set struct {
// Dir is the directory's path in the repository.
Dir string
// Target is the make target that renders it.
Target string
// FS is the embedded directory.
FS fs.FS
}
Set is one embedded directory of rendered manifests.
func Unrendered ¶
Unrendered returns the sets that hold no YAML manifests.