Each unit test subdirectory suite has a set of basic tests it runs.
EnsureTestCoverage
: validates that every operations file in the subdirectory has at least oneInterpolateTest
test.ReadmeTest
: validates that every operations file in the subdirectory has a README entry.InterpolateTest
: runs abosh interpolate
againstcf-deployment.yml
as a validation.
Of these three tests, InterpolateTest
is the only one that is not
automatically determined based on the subdirectory configuration.
Additionally, the semantic_test
suite runs several tests that are not
specific to any subdirectory and put an emphasis on possible semantic errors.
To run the base tests locally run ./test
.
To focus a specific suite use the --run Test<SuiteName>/<TestName>
.
SuiteName
is the title cased version of the suite. (e.g. Standard or IAAS)TestName
is usually the name of the opsfile in kebab-cased. (e.g.bosh-lite.yml
) Note for both sides of the/
, go test uses a Regex substring match.
An InterpolateTest
is composed of helpers.OpsFileTestParams
.
The minimal test is:
"opsfile.yml": {}
In this case opsfile.yml
is the name of the operations file being tested.
The optional bosh interpolate
configurations are:
Ops
[]string
: an ordered list of operations files to be added via the-o
flag. These must be relative to the subdirectory being tested.Vars
[]string
: a list of-vars
arguments to be added.VarsFiles
[]string
: a list of-vars-file
arguments to be added.