testhelpers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildsToRuntimeObjs added in v0.4.0

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)

Jump to

Keyboard shortcuts

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