testhelpers

package
v3.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: Apache-2.0 Imports: 20 Imported by: 2

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

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

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

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

func AssertFileContains

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

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

func AssertFileDoesNotContain

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 AssertFilesEqualText added in v3.0.69

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

AssertFilesEqualText asserts that all the given paths in the expected dir are equal to the files in the actual dir

func AssertFilesExist

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

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

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 GetDefaultBranch added in v3.0.121

func GetDefaultBranch(t *testing.T) string

GetDefaultBranch gets the default branch name for tests

func IsDebugLog

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

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

RequireConfigMapExists requires that the given configMap exists

func RequireSecretExists

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

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