Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Evaluate ¶
func Evaluate[T function.Inputs](t *testing.T, synth function.SynthFunc[T], scenarios ...Scenario[T])
Evaluate runs the synthesizer function with the provided scenarios and asserts on the outputs.
func InputsMatchSynthesizerRefs ¶ added in v0.1.23
func InputsMatchSynthesizerRefs(t require.TestingT, inputObject any, synthesizerPath string, mode KeyMatchMode)
InputsMatchSynthesizerRefs is ensures your synthsizers references stay in sync with the eno_keys to the struct you give function.SynthFunc The level of sync can be defined by the KeyMatchMode parameter
Types ¶
type Assertion ¶
func AssertionChain ¶
AssertionChain is a helper function to create an assertion that runs multiple assertions in sequence.
func LoadSnapshots ¶
LoadSnapshots returns an assertion that will compare the outputs of a synthesizer function with the expected outputs stored in snapshot files.
Scenarios that do not have a corresponding snapshot file will be ignored. To generate snapshots, set the ENO_GEN_SNAPSHOTS environment variable to a non-empty value.
So, to bootstrap snapshots for a given fixture/scenario: create an empty snapshot file that matches the name of the scenario (or fixture if using LoadScenarios), and run the tests with ENO_GEN_SNAPSHOTS=true.
func ValidateResourceMeta ¶ added in v0.1.31
ValidateResourceMeta is an Assertion that proves the outputs are valid resources from Eno's perspective e.g. contain only valid metadata like eno.azure.io/* annotations.
type KeyMatchMode ¶ added in v0.1.23
type KeyMatchMode int
const ( KeyMatchStrict KeyMatchMode = iota // all eno_keys must have a corresponding ref KeyMatchRelaxed // eno_keys can be a subset of refs )