test

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package test implements utility routes to test the functionality provided by the injector package.

Index

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

func LoadExpectedEnvoyYAML(expectationFilePath string) string

LoadExpectedEnvoyYAML loads the expectation for a given test from the file system. This must run within ginkgo.It()

func MarshalAndSaveToFile

func MarshalAndSaveToFile(someStruct interface{}, filePath string) string

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL