helpers

package
v0.0.0-...-75da391 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendRandomString

func AppendRandomString(prefix string) string

AppendRandomString will generate a random string that begins with prefix. This is useful if you want to make sure that your tests can run at the same time against the same environment without conflicting. This method will use "-" as the separator between the prefix and the random suffix. This method will seed rand with the current time when the package is initialized.

func GetBaseFuncName

func GetBaseFuncName(fullFuncName string) string

GetBaseFuncName returns the baseFuncName parsed from the fullFuncName. eg. test/e2e.TestMain will return TestMain.

func MakeK8sNamePrefix

func MakeK8sNamePrefix(s string) string

MakeK8sNamePrefix converts each chunk of non-alphanumeric character into a single dash and also convert camelcase tokens into dash-delimited lowercase tokens.

func ObjectNameForTest

func ObjectNameForTest(t *testing.T) string

ObjectNameForTest generates a random object name based on the test name.

func ObjectPrefixForTest

func ObjectPrefixForTest(t *testing.T) string

ObjectPrefixForTest returns the name prefix for this test's random names.

Types

This section is empty.

Jump to

Keyboard shortcuts

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