testhelpers

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildsToRuntimeObjs

func BuildsToRuntimeObjs(builds []*v1alpha2.Build) []runtime.Object

func CompactJSON

func CompactJSON(spacedJSONStr string) string

func MakeTestBuilds

func MakeTestBuilds(image string, namespace string) []*v1alpha2.Build

func TestK8sActions

func TestK8sActions(
	t *testing.T,
	clientset *k8sfakes.Clientset,
	expectUpdates []clientgotesting.UpdateActionImpl,
	expectCreates []runtime.Object,
	expectDeletes []clientgotesting.DeleteActionImpl,
	expectPatches []string,
)

func TestK8sAndKpackActions

func TestK8sAndKpackActions(
	t *testing.T,
	k8sClientSet *k8sfakes.Clientset,
	kpackClientSet *kpackfakes.Clientset,
	expectUpdates []clientgotesting.UpdateActionImpl,
	expectCreates []runtime.Object,
	expectDeletes []clientgotesting.DeleteActionImpl,
	expectPatches []string,
)

func TestKpackActions

func TestKpackActions(
	t *testing.T,
	clientset *kpackfakes.Clientset,
	expectUpdates []clientgotesting.UpdateActionImpl,
	expectCreates []runtime.Object,
	expectDeletes []clientgotesting.DeleteActionImpl,
	expectPatches []string,
)

Types

type ActionRecorder

type ActionRecorder interface {
	Actions() []clientgotesting.Action
}

ActionRecorder contains list of K8s request actions.

type ActionRecorderList

type ActionRecorderList []ActionRecorder

ActionRecorderList is a list of ActionRecorder objects.

func (ActionRecorderList) ActionsByVerb

func (l ActionRecorderList) ActionsByVerb() (Actions, error)

ActionsByVerb fills in Actions objects, sorting the actions by verb.

type CommandTest

type CommandTest struct {
	Objects []runtime.Object

	StdIn string
	Args  []string

	ExpectErr           bool
	ExpectedOutput      string
	ExpectedErrorOutput string
	ExpectUpdates       []clientgotesting.UpdateActionImpl
	ExpectCreates       []runtime.Object
	ExpectDeletes       []clientgotesting.DeleteActionImpl
	ExpectPatches       []string
}

func (CommandTest) TestK8s

func (c CommandTest) TestK8s(t *testing.T, cmdFactory func(clientSet *k8sfakes.Clientset) *cobra.Command)

func (CommandTest) TestK8sAndKpack

func (c CommandTest) TestK8sAndKpack(t *testing.T, cmdFactory func(k8sClientSet *k8sfakes.Clientset, kpackClientSet *kpackfakes.Clientset) *cobra.Command)

func (CommandTest) TestKpack

func (c CommandTest) TestKpack(t *testing.T, cmdFactory func(clientSet *kpackfakes.Clientset) *cobra.Command)

type DiffBuilder

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

func NewDiffBuilder

func NewDiffBuilder(t *testing.T) *DiffBuilder

func (*DiffBuilder) Configure

func (d *DiffBuilder) Configure(options DiffOptions) *DiffBuilder

func (*DiffBuilder) New

func (d *DiffBuilder) New(str string) *DiffBuilder

func (*DiffBuilder) NoD

func (d *DiffBuilder) NoD(str string) *DiffBuilder

func (*DiffBuilder) Old

func (d *DiffBuilder) Old(str string) *DiffBuilder

func (*DiffBuilder) Out

func (d *DiffBuilder) Out() string

func (*DiffBuilder) Reset

func (d *DiffBuilder) Reset() *DiffBuilder

func (*DiffBuilder) SetPrefix

func (d *DiffBuilder) SetPrefix(prefix string) *DiffBuilder

func (*DiffBuilder) Txt

func (d *DiffBuilder) Txt(str string) *DiffBuilder

type DiffOptions

type DiffOptions struct {
	Prefix         string
	Color          bool
	TrimOutNewline bool
}

func DefaultDiffOptions

func DefaultDiffOptions() DiffOptions

type FakeClientSetProvider

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

func GetFakeClusterProvider

func GetFakeClusterProvider(k8sClient *k8sfakes.Clientset, kpackClient *kpackfakes.Clientset) FakeClientSetProvider

func GetFakeK8sProvider

func GetFakeK8sProvider(k8sClient *k8sfakes.Clientset, namespace string) FakeClientSetProvider

func GetFakeKpackClusterProvider

func GetFakeKpackClusterProvider(kpackClient *kpackfakes.Clientset) FakeClientSetProvider

func GetFakeKpackProvider

func GetFakeKpackProvider(kpackClient *kpackfakes.Clientset, namespace string) FakeClientSetProvider

func (FakeClientSetProvider) GetClientSet

func (f FakeClientSetProvider) GetClientSet(namespace string) (clientSet k8s.ClientSet, err error)

type FakeFetcher added in v0.17.2

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

func NewFakeFetcher added in v0.17.2

func NewFakeFetcher() *FakeFetcher

func (*FakeFetcher) Fetch added in v0.17.2

func (f *FakeFetcher) Fetch(keychain authn.Keychain, src string) (v1.Image, error)

func (*FakeFetcher) SetError added in v0.17.2

func (f *FakeFetcher) SetError(err string)

func (*FakeFetcher) SetImage added in v0.17.2

func (f *FakeFetcher) SetImage(imageRef string, image v1.Image)

Jump to

Keyboard shortcuts

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