Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsExecution ¶ added in v1.3.0
IsExecution asserts executionError.
func ProjectRoot ¶ added in v1.10.0
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 ¶ added in v1.7.0
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. AWSConfig) 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.