test

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualFromYamlFile added in v0.1.3

func EqualFromYamlFile[k8sobject comparable](t *testing.T, expectedYamlFile string, actual client.Object, s runtime.ObjectTyper)

func RunWithTimeout added in v0.1.3

func RunWithTimeout(f func() error, timeout time.Duration, interval time.Duration) (isTimeout bool, err error)

Types

type TestCase

type TestCase struct {
	// Permit to lauch some preaction, like init mock
	PreTest func(stepName *string, data map[string]any) error
	Steps   []TestStep
	// contains filtered or unexported fields
}

func NewTestCase

func NewTestCase(t *testing.T, c client.Client, key types.NamespacedName, o client.Object, wait time.Duration, data map[string]any) *TestCase

func (*TestCase) Run

func (h *TestCase) Run()

type TestStep

type TestStep struct {
	Name  string
	Pre   func(c client.Client, data map[string]any) error
	Do    func(c client.Client, key types.NamespacedName, o client.Object, data map[string]any) error
	Check func(t *testing.T, c client.Client, key types.NamespacedName, o client.Object, data map[string]any) error
}

Jump to

Keyboard shortcuts

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