Documentation ¶
Index ¶
- Variables
- func ExpectError(err error, explain ...interface{})
- func ExpectNoError(err error, explain ...interface{})
- func Logf(format string, args ...interface{})
- func RandomAlphabaticalString(length int) string
- func RandomStringWithCharset(length int, charset string) string
- type Framework
- func (f Framework) CreateNamespace(baseName string, labels map[string]string) (*corev1.Namespace, error)
- func (f *Framework) GetManager() ctrl.Manager
- func (f Framework) GetNamespace() string
- func (f Framework) GetRootPath() string
- func (f *Framework) InitOnRunningSuite()
- func (f *Framework) Start()
- func (f *Framework) TeardownCluster()
- type Options
Constants ¶
This section is empty.
Variables ¶
var RunID = uuid.NewUUID()
RunID is a unique identifier of the integration run. Beware that this ID is not the same for all tests in the e2e run, because each Ginkgo node creates it separately.
Functions ¶
func ExpectError ¶
func ExpectError(err error, explain ...interface{})
ExpectError expects an error happens, otherwise an exception raises
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
ExpectNoError checks if "err" is set, and if so, fails assertion while logging the error.
func RandomAlphabaticalString ¶
RandomAlphabaticalString generates a random alphabatical string of given length
func RandomStringWithCharset ¶
RandomStringWithCharset generates a random string of given length from the given charset
Types ¶
type Framework ¶
type Framework struct { BaseName string UniqueName string Client client.Client ClientSet clientset.Interface Namespace *corev1.Namespace // contains filtered or unexported fields }
Framework supports common operations used by e2e tests; it will keep a client & a namespace for you.
func NewDefaultFramework ¶
NewDefaultFramework creates a new Test Framework with default options (like RootPath)
func NewFramework ¶
NewFramework creates a new Test Framework with CRDs
func (Framework) CreateNamespace ¶
func (f Framework) CreateNamespace(baseName string, labels map[string]string) (*corev1.Namespace, error)
CreateNamespace creates a new namespace with randomized name from the given baseName and labels
func (*Framework) GetManager ¶
GetManager either gets an existing manager or creates a new one
func (Framework) GetNamespace ¶
GetNamespace returns the ephemeral namespace for the test
func (Framework) GetRootPath ¶
GetRootPath returns the configured root path of controller
func (*Framework) InitOnRunningSuite ¶
func (f *Framework) InitOnRunningSuite()
InitOnRunningSuite sets up ginkgo's BeforeEach & AfterEach. It must be called within running ginkgo suite (like Describe, Context etc)
func (*Framework) Start ¶
func (f *Framework) Start()
Start bootstraps the test env and sets the client
func (*Framework) TeardownCluster ¶
func (f *Framework) TeardownCluster()
TeardownCluster stops the test environment