Documentation
¶
Overview ¶
Package testutil is a collection of supporting code to run bldr integration tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDockerAvailable ¶
IsDockerAvailable returns nil if docker buildx is ready to use.
Types ¶
type CommandRunner ¶
CommandRunner is an abstract runner mix-in which processes command result.
type DockerRunner ¶
type DockerRunner struct {
CommandRunner
Target string
Platform string
}
DockerRunner runs bldr via docker buildx.
func (DockerRunner) Run ¶
func (runner DockerRunner) Run(t *testing.T)
Run implements Run interface.
type EvalRunner ¶
type EvalRunner struct {
CommandRunner
Target string
Template string
}
EvalRunner runs bldr eval.
type IntegrationTest ¶
type IntegrationTest struct {
Name string
Path string
Manifest TestManifest
}
IntegrationTest describes single integration set (common testdata).
func (IntegrationTest) Run ¶
func (test IntegrationTest) Run(t *testing.T)
Run executes integration test.
type RunManifest ¶
type RunManifest struct {
Name string `yaml:"name"`
Runner string `yaml:"runner"`
Platform string `yaml:"platform"`
Target string `yaml:"target"`
Expect string `yaml:"expect"`
ExpectStdout *string `yaml:"expectStdout"`
CreateFile string `yaml:"createFile"`
Template string `yaml:"template"`
}
RunManifest describes single run of integration test.
type TestCollection ¶
type TestCollection struct {
Tests []IntegrationTest
}
TestCollection is a set of integration tests.
func CollectTests ¶
func CollectTests() (*TestCollection, error)
CollectTests builds TestCollection from directory structure.
type TestManifest ¶
type TestManifest struct {
Runs []RunManifest `yaml:"run"`
}
TestManifest describes single integration test in test.yaml.
func NewTestManifest ¶
func NewTestManifest(path string) (manifest TestManifest, err error)
NewTestManifest loads TestManifest from test.yaml file.
type ValidateRunner ¶
type ValidateRunner struct {
CommandRunner
}
ValidateRunner runs bldr validate.
func (ValidateRunner) Run ¶
func (runner ValidateRunner) Run(t *testing.T)
Run implements Run interface.