test

package
v0.0.0-...-8ee384e Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToInformer

func AddToInformer(t *testing.T, store cache.Store) func(ktesting.Action) (bool, runtime.Object, error)

func PrependResourceVersionReactor

func PrependResourceVersionReactor(f *ktesting.Fake)

PrependResourceVersionReactor will instrument a client-go testing Fake with a reactor that simulates resourceVersion changes on mutations. This does not work with patches.

func SeedTestData

func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers)

SeedTestData returns Clients and Informers populated with the given Data. nolint: golint

Types

type Assets

type Assets struct {
	Logger     *zap.SugaredLogger
	Controller *controller.Impl
	Clients    Clients
	Informers  Informers
	Recorder   *record.FakeRecorder
	Ctx        context.Context
}

Assets holds references to the controller, logs, clients, and informers.

type Clients

Clients holds references to clients which are useful for reconciler tests.

type Data

type Data struct {
	PipelineRuns    []*v1beta1.PipelineRun
	Pipelines       []*v1beta1.Pipeline
	TaskRuns        []*v1beta1.TaskRun
	Tasks           []*v1beta1.Task
	ClusterTasks    []*v1beta1.ClusterTask
	CustomRuns      []*v1beta1.CustomRun
	Pods            []*corev1.Pod
	Namespaces      []*corev1.Namespace
	ConfigMaps      []*corev1.ConfigMap
	ServiceAccounts []*corev1.ServiceAccount
}

Data represents the desired state of the system (i.e. existing resources) to seed controllers with.

type Informers

Informers holds references to informers which are useful for reconciler tests.

type ResourceVersionReactor

type ResourceVersionReactor struct {
	// contains filtered or unexported fields
}

func (*ResourceVersionReactor) Handles

func (r *ResourceVersionReactor) Handles(action ktesting.Action) bool

func (*ResourceVersionReactor) React

func (r *ResourceVersionReactor) React(action ktesting.Action) (handled bool, ret runtime.Object, err error)

React is noop-function

Jump to

Keyboard shortcuts

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