Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProviderFlavors = []string{capiFlavor, vintageFlavor}
Functions ¶
func EquateErrors ¶
EquateErrors returns true if the supplied errors are of the same type and produce identical strings. This mirrors the error comparison behaviour of https://github.com/go-test/deep,
This differs from cmpopts.EquateErrors, which does not test for error strings and instead returns whether one error 'is' (in the errors.Is sense) the other.
func ProjectRoot ¶
func ProjectRoot() string
ProjectRoot returns absolute path to prometheus-meta-operator root directory. This comes in handy when you need to access files in this repository from a test.
Types ¶
type Marshaller ¶
type Runner ¶
type Runner struct { OutputDir string T *testing.T Marshaller Marshaller TestFunc TestFunc TestFuncReturnsBytes bool Update bool // contains filtered or unexported fields }
Runner is used to run unit test for a specific resource. It does so by running TestFunc with different input and compare the result with expected outputs.
TestFunc is a function which takes the observed kubernetes object as input (e.g. Cluster) and returns another kubernetes object (e.g. Service).
OutputDir holds yaml files, representing the yaml version of the object returned by TestFunc. Files are mapped 1 to 1 from input to output directory. e.g. when a file called `foo` is placed in the input directory, a corresponding file named `foo` must be placed in the output directory.
Input directory is harcoded as the input directory in this package.