test

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNamespace

func DeleteNamespace(c client.Client, namespace string) error

func EnsureNamespace

func EnsureNamespace(c client.Client, namespace string) error

func GetLogOfPod

func GetLogOfPod(rest *rest.RESTClient, namespace, name string, logOptions *corev1.PodLogOptions, out io.Writer) error

func WaitForController

func WaitForController(c client.Client, namespace, name string, replica int32, retryInterval, timeout time.Duration) error

func WaitForDeletion

func WaitForDeletion(dynclient client.Client, obj runtime.Object, retryInterval, timeout time.Duration) error

func WaitForJobFail

func WaitForJobFail(c client.Client, namespace, name string, retryInterval, timeout time.Duration) error

func WaitForJobSucceed

func WaitForJobSucceed(c client.Client, namespace, name string, retryInterval, timeout time.Duration) error

Types

type AddToSchemeFunc

type AddToSchemeFunc = func(*runtime.Scheme) error

type CleanupOptions

type CleanupOptions struct {
	TestContext   *TestCtx
	Timeout       time.Duration
	RetryInterval time.Duration
}

type Scanner

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

Scanner scans a yaml manifest file for manifest tokens delimited by "---". See bufio.Scanner for semantics.

func NewYAMLScanner

func NewYAMLScanner(b []byte) *Scanner

func (*Scanner) Bytes

func (s *Scanner) Bytes() []byte

func (*Scanner) Err

func (s *Scanner) Err() error

func (*Scanner) Scan

func (s *Scanner) Scan() bool

func (*Scanner) Text

func (s *Scanner) Text() string

type TestCtx

type TestCtx struct {
	Client client.Client
	ID     string

	Namespace string
	// contains filtered or unexported fields
}

func NewTestCtx

func NewTestCtx(t *testing.T, namespace string) *TestCtx

func (*TestCtx) AddCleanupFn

func (ctx *TestCtx) AddCleanupFn(fn cleanupFn)

func (*TestCtx) Cleanup

func (ctx *TestCtx) Cleanup(option *CleanupOptions)

func (*TestCtx) CreateFromYAML

func (ctx *TestCtx) CreateFromYAML(yamlFile []byte, skipIfExists bool) error

func (*TestCtx) GetID

func (ctx *TestCtx) GetID() string

func (*TestCtx) Setup

func (t *TestCtx) Setup(yamlPath string, crdPath string, schemes ...AddToSchemeFunc) error

Jump to

Keyboard shortcuts

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