testhelpers

package
v1.0.88 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2020 License: Apache-2.0 Imports: 19 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 AssertDirContentsEqual added in v1.0.67

func AssertDirContentsEqual(t *testing.T, expectedDir string, actualDir string)

AssertDirContentsEqual walks two directory structures and validates that the same files exist (by name) and that they have the same content

func AssertDirsExist added in v1.0.67

func AssertDirsExist(t *testing.T, expected bool, paths ...string)

AssertDirsExist asserts that the list of directory paths either exist or don't exist

func AssertEqualFileText added in v1.0.67

func AssertEqualFileText(t *testing.T, expectedFile string, actualFile string) error

func AssertFileContains added in v1.0.67

func AssertFileContains(t *testing.T, fileName string, containsText string)

AssertFileContains asserts that a given file exists and contains the given text

func AssertFileDoesNotContain added in v1.0.67

func AssertFileDoesNotContain(t *testing.T, fileName string, containsText string)

AssertFileDoesNotContain asserts that a given file exists and does not contain the given text

func AssertFileNotExists

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

AssertFileNotExists asserts that a file does not exist

func AssertFilesExist added in v1.0.67

func AssertFilesExist(t *testing.T, expected bool, paths ...string)

AssertFilesExist asserts that the list of file paths either exist or don't 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 AssertLoadFileText added in v1.0.67

func AssertLoadFileText(t *testing.T, fileName string) (string, error)

AssertLoadFileText asserts that the given file name can be loaded and returns the string contents

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 AssertTextFileContentsEqual added in v1.0.67

func AssertTextFileContentsEqual(t *testing.T, expectedFile string, actualFile string)

AssertTextFileContentsEqual asserts that both the expected and actual files can be loaded as text and that their contents are identical

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 IsDebugLog added in v1.0.67

func IsDebugLog() bool

IsDebugLog debug log?

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

func TestShouldDisableMaven added in v1.0.67

func TestShouldDisableMaven() bool

TestShouldDisableMaven should disable maven

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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