Documentation ¶
Overview ¶
Package test implements utility routes to test the functionality provided by the injector package.
Index ¶
- func Compare(...)
- func LoadExpectedEnvoyYAML(expectationFilePath string) string
- func MarshalAndSaveToFile(someStruct interface{}, filePath string) string
- func MarshalXdsStructAndSaveToFile(m protoreflect.ProtoMessage, filePath string) string
- func ThisXdsClusterFunction(functionName string, fn func() protoreflect.ProtoMessage)
- func ThisXdsListenerFunction(functionName string, fn func() (protoreflect.ProtoMessage, error))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compare ¶
func Compare(functionName, actualFilename, expectedFilename, actualYAML, expectedYAML string)
Compare is a wrapper around gomega.Expect().To(Equal()) and compares actualYAML and expectedYAML; It also provides a verbose message when things don't match with a tip on how to fix things.
func LoadExpectedEnvoyYAML ¶
LoadExpectedEnvoyYAML loads the expectation for a given test from the file system. This must run within ginkgo.It()
func MarshalAndSaveToFile ¶
MarshalAndSaveToFile converts a generic Go struct into YAML and saves it to a file. This must run within ginkgo.It()
func MarshalXdsStructAndSaveToFile ¶
func MarshalXdsStructAndSaveToFile(m protoreflect.ProtoMessage, filePath string) string
MarshalXdsStructAndSaveToFile converts a an xDS struct into YAML and saves it to a file. This must run within ginkgo.It()
func ThisXdsClusterFunction ¶
func ThisXdsClusterFunction(functionName string, fn func() protoreflect.ProtoMessage)
ThisXdsClusterFunction runs the given function in a ginkgo.Context(), marshals the output and compares to an expectation loaded from file.
func ThisXdsListenerFunction ¶
func ThisXdsListenerFunction(functionName string, fn func() (protoreflect.ProtoMessage, error))
ThisXdsListenerFunction runs the given function in a ginkgo.Context(), marshals the output and compares to an expectation loaded from file.
Types ¶
This section is empty.