testhelpers

package
v1.0.66 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertAnnotation

func AssertAnnotation(t *testing.T, annotation string, expected string, objectMeta metav1.ObjectMeta, kindMessage string)

AssertAnnotation asserts the object has the given annotation value

func AssertConfigMapEntryEquals

func AssertConfigMapEntryEquals(t *testing.T, resource *corev1.ConfigMap, key string, expected string, kindMessage string) string

AssertConfigMapEntryEquals asserts the ConfigMap resource has the given data value

func AssertConfigMapHasEntry

func AssertConfigMapHasEntry(t *testing.T, resource *corev1.ConfigMap, key string, kindMessage string) string

AssertConfigMapData asserts the ConfigMap resource has the given data value

func AssertFileNotExists

func AssertFileNotExists(t *testing.T, path string)

AssertFileNotExists asserts that a file does not exist

func AssertLabel

func AssertLabel(t *testing.T, label string, expected string, objectMeta metav1.ObjectMeta, kindMessage string)

AssertLabel asserts the object has the given label value

func AssertSecretEntryEquals

func AssertSecretEntryEquals(t *testing.T, secret *corev1.Secret, key string, expected string, kindMessage string) string

AssertSecretEntryEquals asserts the Secret resource has the given value

func AssertTextFilesEqual

func AssertTextFilesEqual(t *testing.T, expected string, actual string, message string)

AssertTextFilesEqual asserts that the expected file matches the actual file contents

func AssertYamlEqual

func AssertYamlEqual(t *testing.T, expected string, actual string, message string, args ...interface{})

AssertYamlEqual validates YAML without worrying about ordering of keys

func AssertYamlFilesEqual

func AssertYamlFilesEqual(t *testing.T, expectedFile string, actualFile string, message string, args ...interface{})

AssertYamlFilesEqual validates YAML file names without worrying about ordering of keys

func ObjectNameMessage

func ObjectNameMessage(objectMeta metav1.ObjectMeta, kindMessage string) string

ObjectNameMessage returns an object name message used in the tests

func RequireConfigMapExists added in v1.0.46

func RequireConfigMapExists(t *testing.T, client kubernetes.Interface, ns, name string) (*corev1.ConfigMap, string)

RequireConfigMapExists requires that the given configMap exists

func RequireSecretExists added in v1.0.46

func RequireSecretExists(t *testing.T, client kubernetes.Interface, ns, name string) (*corev1.Secret, string)

RequireSecretExists requires that the given secret exists

func SkipForWindows

func SkipForWindows(t *testing.T, reason string)

SkipForWindows skips tests if they are running on Windows This is to be used for valid tests that just don't work on windows for whatever reason

Types

This section is empty.

Jump to

Keyboard shortcuts

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