test

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertOutput

func AssertOutput(t *testing.T, expected, actual interface{})

func AssertOutputPrefix added in v0.14.0

func AssertOutputPrefix(t *testing.T, expected, actual string)

func Contains added in v0.18.0

func Contains(t *testing.T, container interface{}, obj interface{})

Contains is a test utility to check if obj is in the contents of the container.

func ExecuteCommand

func ExecuteCommand(root *cobra.Command, args ...string) (string, error)

ExecuteCommand executes the root command passing the args and returns the output as a string and error

func ExecuteCommandC

func ExecuteCommandC(c *cobra.Command, args ...string) (*cobra.Command, string, error)

ExecuteCommandC executes the root command passing the args and returns the root command, output as a string and error if any

func FakeClock added in v0.31.0

func FakeClock() clockwork.FakeClock

func SeedTestData added in v0.3.0

func SeedTestResources added in v0.7.0

func SeedTestResources(t *testing.T, d triggerstest.Resources) triggerstest.Clients

func SeedV1beta1TestData added in v0.9.0

func SeedV1beta1TestData(t *testing.T, d Data) (Clients, Informers)

Types

type Clients added in v0.30.0

type Clients struct {
	Pipeline *fakepipelineclientset.Clientset
	Kube     *fakekubeclientset.Clientset
}

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

type Data added in v0.30.0

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

type Informers added in v0.30.0

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

type Params

type Params struct {
	Tekton   versioned.Interface
	Triggers versionedTriggers.Interface
	Kube     k8s.Interface
	Clock    clockwork.Clock
	Cls      *cli.Clients
	Dynamic  dynamic.Interface
	// contains filtered or unexported fields
}

func (*Params) Clients

func (p *Params) Clients(_ ...*rest.Config) (*cli.Clients, error)

func (*Params) KubeClient added in v0.5.0

func (p *Params) KubeClient() (k8s.Interface, error)

func (*Params) KubeConfigPath

func (p *Params) KubeConfigPath() string

func (*Params) Namespace

func (p *Params) Namespace() string

func (*Params) SetKubeConfigPath

func (p *Params) SetKubeConfigPath(path string)

func (*Params) SetKubeContext added in v0.6.0

func (p *Params) SetKubeContext(context string)

func (*Params) SetNamespace

func (p *Params) SetNamespace(ns string)

func (*Params) SetNoColour added in v0.4.0

func (p *Params) SetNoColour(_ bool)

func (*Params) Time

func (p *Params) Time() clockwork.Clock

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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