integration

package
v0.0.0-...-0585a07 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BigPollingInterval   = 3 * time.Second
	BigTimeOut           = 40 * time.Second
	SmallTimeOut         = 5 * time.Second
	SmallPollingInterval = 1 * time.Second
)

Variables

This section is empty.

Functions

func StartEnvTest

func StartEnvTest(projectRootDir string) (*envtest.Environment, *rest.Config, error)

Types

type TestEnvironment

type TestEnvironment struct {
	EnvTestInstance *envtest.Environment

	K8sDynamicClient *dynamic.DynamicClient
	KubeClient       kcmk8s.Client
	Reconciler       *kcmctrl.Reconciler
	Logger           *zap.SugaredLogger
	Recorder         *record.EventRecorder
	TestCancelFn     context.CancelFunc
	// contains filtered or unexported fields
}

TestEnvironment provides mocked resources for integration tests.

func NewTestEnvironment

func NewTestEnvironment(projectRootDir string) (*TestEnvironment, error)

func (TestEnvironment) CreateK8sResource

func (env TestEnvironment) CreateK8sResource(ctx context.Context, obj client.Object) error

func (TestEnvironment) CreateUnstructuredK8sResource

func (env TestEnvironment) CreateUnstructuredK8sResource(ctx context.Context, obj *unstructured.Unstructured) error

func (TestEnvironment) DeleteConfigMapFromK8s

func (env TestEnvironment) DeleteConfigMapFromK8s(ctx context.Context, name, namespace string) error

func (TestEnvironment) DeleteSecretFromK8s

func (env TestEnvironment) DeleteSecretFromK8s(ctx context.Context, name, namespace string) error

func (TestEnvironment) DeleteServiceFromK8s

func (env TestEnvironment) DeleteServiceFromK8s(ctx context.Context, name, namespace string) error

func (TestEnvironment) EnsureK8sConfigMapExists

func (env TestEnvironment) EnsureK8sConfigMapExists(t *testing.T, ctx context.Context, name, namespace string)

func (TestEnvironment) EnsureK8sConfigMapNotFound

func (env TestEnvironment) EnsureK8sConfigMapNotFound(t *testing.T, ctx context.Context, name, namespace string)

func (TestEnvironment) EnsureK8sResourceCreated

func (env TestEnvironment) EnsureK8sResourceCreated(t *testing.T, ctx context.Context, obj client.Object)

func (TestEnvironment) EnsureK8sResourceDeleted

func (env TestEnvironment) EnsureK8sResourceDeleted(t *testing.T, ctx context.Context, obj client.Object)

func (TestEnvironment) EnsureK8sResourceUpdated

func (env TestEnvironment) EnsureK8sResourceUpdated(t *testing.T, ctx context.Context, obj client.Object)

func (TestEnvironment) EnsureK8sSecretExists

func (env TestEnvironment) EnsureK8sSecretExists(t *testing.T, ctx context.Context, name, namespace string)

func (TestEnvironment) EnsureK8sSecretNotFound

func (env TestEnvironment) EnsureK8sSecretNotFound(t *testing.T, ctx context.Context, name, namespace string)

func (TestEnvironment) EnsureK8sServiceExists

func (env TestEnvironment) EnsureK8sServiceExists(t *testing.T, ctx context.Context, name, namespace string)

func (TestEnvironment) EnsureK8sServiceNotFound

func (env TestEnvironment) EnsureK8sServiceNotFound(t *testing.T, ctx context.Context, name, namespace string)

func (TestEnvironment) EnsureK8sUnStructResourceCreated

func (env TestEnvironment) EnsureK8sUnStructResourceCreated(t *testing.T, ctx context.Context,
	obj *unstructured.Unstructured,
)

func (TestEnvironment) EnsureNamespaceCreation

func (env TestEnvironment) EnsureNamespaceCreation(t *testing.T, ctx context.Context, namespace string)

func (TestEnvironment) GetCompanionCRFromK8s

func (env TestEnvironment) GetCompanionCRFromK8s(ctx context.Context,
	name, namespace string,
) (kcmv1alpha1.Companion, error)

func (TestEnvironment) GetConfigMapFromK8s

func (env TestEnvironment) GetConfigMapFromK8s(ctx context.Context,
	name, namespace string,
) (*kcorev1.ConfigMap, error)

func (TestEnvironment) GetSecretFromK8s

func (env TestEnvironment) GetSecretFromK8s(ctx context.Context, name, namespace string) (*kcorev1.Secret, error)

func (TestEnvironment) GetServiceFromK8s

func (env TestEnvironment) GetServiceFromK8s(ctx context.Context, name, namespace string) (*kcorev1.Service, error)

func (TestEnvironment) TearDown

func (env TestEnvironment) TearDown() error

Jump to

Keyboard shortcuts

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