Documentation ¶
Index ¶
- func CompareDir(t *testing.T, expectDir, actualDir string)
- func CompareFile(t *testing.T, expectDir, actualDir string, relPath string)
- func CompareGoldenFile(t *testing.T, expectedPath string, got []byte)
- func CopyDir(src, dest string) error
- func CopyFile(src, dest string) error
- func IsValidYAMLOrKptfile(fname string) bool
- func MustReadFile(t *testing.T, expectedPath string) []byte
- func RunGoldenTests(t *testing.T, basedir string, krmFunction fn.ResourceListProcessor)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareDir ¶
CompareDir compares the contents of two directories only compare KRM YAML resources?
func CompareFile ¶
CompareFile compares a single file of the same relative path between "expectDir" and "actualDir"
func CompareGoldenFile ¶
CompareGoldenFile compares the "got" data with the data stored in a "expectedPath".
func IsValidYAMLOrKptfile ¶
func MustReadFile ¶
MustReadFile reads the data from "expectedPath"
func RunGoldenTests ¶
func RunGoldenTests(t *testing.T, basedir string, krmFunction fn.ResourceListProcessor)
RunGoldenTests provides the test infra to run golden test. "basedir" should be the parent directory, under where the sub-directories contains test data. For example, the "testdata" is the basedir. It contains two cases "test1" and "test2"
└── testdata └── test1 ├── _expected.yaml ├── _fnconfig.yaml └── resources.yaml └── test2 ├── _expected.yaml ├── _fnconfig.yaml └── resources.yaml
- "krmFunction" should be your ResourceListProcessor implementation.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.