framework

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: UPL-1.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Framework

type Framework struct {
	// k8s controller-runtime client is used in most of the controller operations.
	K8sClient client.Client
	// k8s client-go client set is needed when additional k8s operations are involved in tests.
	K8sClientset kubernetes.Interface
	// k8sAPIs supports kube-apiserver CRUD operations for each kind of resource.
	K8sAPIs    k8s.K8sAPIs
	MeshClient *meshMocks.MockServiceMeshClient
	Resolver   *meshMocks.MockResolver
	Cache      *meshMocks.MockCacheMapClient
	Log        loggerutil.OSOKLogger
	// contains filtered or unexported fields
}

Framework supports common operations used by unit tests. It comes with a K8sClient, K8sClientset and K8sAPIs.

func NewDefaultFramework

func NewDefaultFramework(k8sClient client.Client,
	k8sClientset kubernetes.Interface, t *testing.T) *Framework

func NewFakeClientFramework

func NewFakeClientFramework(t *testing.T) *Framework

NewFakeClientFramework creates a test framework with fake k8sClient and fake k8sClientSet You won't need to create a test namespace using fake clients

func NewTestEnvClientFramework

func NewTestEnvClientFramework(t *testing.T) *Framework

NewTestEnvClientFramework creates a test framework with 8sClient and k8sClientSet using test environment in /testbin You will need to create a test namespace for your test cases

func (*Framework) Cleanup

func (f *Framework) Cleanup()

Jump to

Keyboard shortcuts

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