1
0
mirror of synced 2026-02-13 13:06:56 +00:00

Make test harness more flexible with functions

Replace the 4 arguments to cmdTestCase with a function that
can let tests run arbitrary logic if it is more complex than
what is provided by the test harness. Move the existing logic
into functions that the test can use for common assertions on
golden files and golden values.

These changes were pulled out of PR #1696 to make a smaller review.

Signed-off-by: Allen Porter <allen@thebends.org>
This commit is contained in:
Allen Porter
2021-08-23 08:28:47 -07:00
parent 72294b2a56
commit 3a3bdc62c8
7 changed files with 98 additions and 61 deletions

View File

@@ -49,7 +49,7 @@ func TestKustomizationFromGit(t *testing.T) {
for _, tc := range cases {
cmd := cmdTestCase{
args: tc.args + " -n=" + namespace,
goldenFile: tc.goldenFile,
assert: assertGoldenFile(tc.goldenFile),
testClusterMode: ExistingClusterMode,
}
cmd.runTestCmd(t)