test

package
v0.0.0-...-99d5794 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

README

Test libs

The contents of this folder were copied as-is from https://github.com/tektoncd/experimental/tree/main/pipelines-in-pipelines/test

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 MustParsePipeline

func MustParsePipeline(t *testing.T, yaml string) *v1beta1.Pipeline

func MustParsePipelineRun

func MustParsePipelineRun(t *testing.T, yaml string) *v1beta1.PipelineRun

func MustParseRun

func MustParseRun(t *testing.T, yaml string) *v1alpha1.Run

func MustParseTask

func MustParseTask(t *testing.T, yaml string) *v1beta1.Task

func MustParseTaskRun

func MustParseTaskRun(t *testing.T, yaml string) *v1beta1.TaskRun

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
	PipelineResources []*v1alpha1.PipelineResource
	Conditions        []*v1alpha1.Condition
	Runs              []*v1alpha1.Run
	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 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