(prototype) End-to-end test runner for ytt.
-
Put
./ytt-test.sh
in the $PATH. -
outside of your ytt source directory, create a directory named
.ytt-tests
-
for each test you want to run, create a test file (i.e. with a
.test.yaml
suffix)#! .ytt-tests/sample.test.yaml --- actual: ytt --file ${YTT_SUBJECT}/config/ --data-values-file values.yaml expected: ytt --file expected/
- ytt-test sets
YTT_SUBJECT
to the absolute path to parent directory of.ytt-tests
- ytt-test sets
-
create the fixture(s) for the test
#! .ytt-tests/values.yaml --- instances: 7
-
in the parent directory of
.ytt-tests
run the test runner$ ls -a1F .ytt-tests/ config/ $ ytt-test.sh fail .ytt-tests/sample.test.yaml ==> .ytt-test-out/sample/result.diff FAILURE
-
examine the "actual" result; if acceptable, make it the "expected"
$ mv .ytt-test-out/sample/actual .ytt-tests/expected
-
re-run the test
$ ytt-test.sh pass .ytt-tests/sample.test.yaml SUCCESS
(See also ./examples
)