Documentation ¶
Index ¶
- func EnsureTestDependencies(tb testing.TB, ctx context.Context, testMode TestMode) context.Context
- func RequireValue(tb testing.TB, key string) string
- type CompleteFunc
- type OwnedKubeClients
- func (k *OwnedKubeClients) InstallCRDs(options envtest.CRDInstallOptions) ([]*apiextensionsv1.CustomResourceDefinition, error)
- func (k *OwnedKubeClients) SetupNamespace(tb testing.TB, ctx context.Context) (string, context.CancelFunc)
- func (k *OwnedKubeClients) StartObjectWatch(tb testing.TB, ctx context.Context, object client.Object) CompleteFunc
- type TestMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureTestDependencies ¶
When running the go tests directly, the 'make' environment variables are not available, so here we run 'make' from go to generate all dependencies through make and set the correct environment variables.
Types ¶
type CompleteFunc ¶
type OwnedKubeClients ¶
type OwnedKubeClients struct { EnvTest *envtest.Environment Rest *rest.Config Scheme *runtime.Scheme KubeClient *kubernetes.Clientset Client client.WithWatch }
func KubeClients ¶
func KubeClients(tb testing.TB, ctx context.Context) *OwnedKubeClients
func (*OwnedKubeClients) InstallCRDs ¶
func (k *OwnedKubeClients) InstallCRDs(options envtest.CRDInstallOptions) ([]*apiextensionsv1.CustomResourceDefinition, error)
func (*OwnedKubeClients) SetupNamespace ¶
func (k *OwnedKubeClients) SetupNamespace(tb testing.TB, ctx context.Context) (string, context.CancelFunc)
func (*OwnedKubeClients) StartObjectWatch ¶
func (k *OwnedKubeClients) StartObjectWatch( tb testing.TB, ctx context.Context, object client.Object, ) CompleteFunc
StartObjectWatch starts a watch for the provided object, the returned function should be used to wait for a condition to succeed. The watch will start after calling this function. This means that the completion function can respond to events received before calling the complete function but after calling StartObjectWatch.
type TestMode ¶
type TestMode string
func CurrentTestMode ¶
Extract from the context what the test mode is of the current test. If value is not set, 'UnknownTest' is returned.
Click to show internal directories.
Click to hide internal directories.