tests

package
v0.0.0-...-6f318c5 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestAwsProfile util.EnvironmentVariable = "TEST_AWS_PROFILE"
	TestAwsRole    util.EnvironmentVariable = "TEST_AWS_ROLE"
	TestAWSBucket  util.EnvironmentVariable = "TEST_AWS_BUCKET"
)
View Source
const FakeJWTSecretName = "fake-jwt-secret"
View Source
const FakeNamespace = "fake"

Variables

This section is empty.

Functions

func Apply

func Apply[T meta.Object](t *testing.T, obj T, mods ...MetaObjectMod[T])

func CastAs

func CastAs[A any](t *testing.T, in any) A

func CreateObjects

func CreateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSet.Interface, objects ...interface{}) func(t *testing.T)

func DeleteObjects

func DeleteObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSet.Interface, objects ...interface{})

func DurationBetween

func DurationBetween() func(t *testing.T, expected time.Duration, skew float64)

func GVK

func GVK(t *testing.T, object meta.Object) schema.GroupVersionKind

func GetAWSClientConfig

func GetAWSClientConfig(t *testing.T) awsHelper.Config

func GetAWSS3Bucket

func GetAWSS3Bucket(t *testing.T) string

func GetContainerByNameT

func GetContainerByNameT(t *testing.T, containers []core.Container, name string) core.Container

func Handle

func Handle(handler operator.Handler, item operation.Item) error

func HandleFunc

func HandleFunc(in func(ctx context.Context) (bool, error)) error

func HandleWithMax

func HandleWithMax(handler operator.Handler, item operation.Item, max int) error

func Interrupt

func Interrupt() error

func IsNamespaced

func IsNamespaced(in meta.Object) bool

func MarkArangoProfileAsReady

func MarkArangoProfileAsReady(t *testing.T, obj *schedulerApi.ArangoProfile)

func NewEmptyInspector

func NewEmptyInspector(t *testing.T) inspectorInterface.Inspector

func NewHTTPServer

func NewHTTPServer(ctx context.Context, t *testing.T, mods ...util.ModEP1[goHttp.Server, context.Context]) string

func NewItem

func NewItem(t *testing.T, o operation.Operation, object meta.Object) operation.Item

func NewMetaObject

func NewMetaObject[T meta.Object](t *testing.T, namespace, name string, mods ...MetaObjectMod[T]) T

func NewMetaObjectInDefaultNamespace

func NewMetaObjectInDefaultNamespace[T meta.Object](t *testing.T, name string, mods ...MetaObjectMod[T]) T

func RefreshObjects

func RefreshObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSet.Interface, objects ...interface{})

func RefreshObjectsC

func RefreshObjectsC(t *testing.T, client kclient.Client, objects ...interface{})

func ResolveAddress

func ResolveAddress(t *testing.T, addr string) (string, int)

func RunCLI

func RunCLI(cmd *cobra.Command, args ...string) error

func SetMetaBasedOnType

func SetMetaBasedOnType(t *testing.T, object meta.Object)

func UpdateObjects

func UpdateObjects(t *testing.T, k8s kubernetes.Interface, arango arangoClientSet.Interface, objects ...interface{}) func(t *testing.T)

func UpdateObjectsC

func UpdateObjectsC(t *testing.T, client kclient.Client, objects ...interface{}) func(t *testing.T)

func WaitForAddress

func WaitForAddress(t *testing.T, addr string, port int)

func WithLogScanner

func WithLogScanner(t *testing.T, name string, in func(t *testing.T, s LogScanner))

Types

type FileGenerator

type FileGenerator interface {
	Parent(t *testing.T) FileGenerator

	Directory(t *testing.T, name string) FileGenerator

	File(t *testing.T, name string, data []byte) FileGenerator

	FileR(t *testing.T, name string, size int) FileGenerator
}

func NewFileGenerator

func NewFileGenerator(t *testing.T, root string) FileGenerator

type KubernetesObject

type KubernetesObject interface {
	meta.Object
	meta.Type
}

type LogScanner

type LogScanner interface {
	Factory() logging.Factory

	Get(timeout time.Duration) (string, bool)
	GetData(t *testing.T, timeout time.Duration, obj interface{}) bool
}

type MetaObjectMod

type MetaObjectMod[T meta.Object] func(t *testing.T, obj T)

type Timeout

type Timeout func() error

func NewTimeout

func NewTimeout(in Timeout) Timeout

func WaitForTCPPort

func WaitForTCPPort(addr string, port int) Timeout

func (Timeout) WithContextTimeout

func (t Timeout) WithContextTimeout(ctx context.Context, timeout, interval time.Duration) error

func (Timeout) WithContextTimeoutT

func (t Timeout) WithContextTimeoutT(z *testing.T, ctx context.Context, timeout, interval time.Duration)

func (Timeout) WithTimeout

func (t Timeout) WithTimeout(timeout, interval time.Duration) error

func (Timeout) WithTimeoutT

func (t Timeout) WithTimeoutT(z *testing.T, timeout, interval time.Duration)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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