apitesting

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 147

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v0.34.0

func Close(t TestingT, c io.Closer)

Close and fail the test if it returns an error.

func CloseNoOp added in v0.34.0

func CloseNoOp(TestingT, io.Closer)

CloseNoOp does nothing. Use as a replacement for Close when you need to disable a defer.

func SchemeForInstallOrDie

func SchemeForInstallOrDie(installFns ...InstallOrDieFunc) (*runtime.Scheme, runtimeserializer.CodecFactory)

SchemeForInstallOrDie builds a simple test scheme and codecfactory pair for easy unit testing from higher level install methods

func SchemeForOrDie

func SchemeForOrDie(installFns ...InstallFunc) (*runtime.Scheme, runtimeserializer.CodecFactory)

SchemeForOrDie builds a simple test scheme and codecfactory pair for easy unit testing from the bare registration methods.

func TestCodec

TestCodec returns the codec for the API version to test against, as set by the KUBE_TEST_API_TYPE env var.

func TestStorageCodec

func TestStorageCodec(codecs runtimeserializer.CodecFactory, gvs ...schema.GroupVersion) runtime.Codec

TestStorageCodec returns the codec for the API version to test against used in storage, as set by the KUBE_TEST_API_STORAGE_TYPE env var.

Types

type InstallFunc

type InstallFunc func(scheme *runtime.Scheme) error

InstallFunc mirrors install functions that can return an error

type InstallOrDieFunc

type InstallOrDieFunc func(scheme *runtime.Scheme)

InstallOrDieFunc mirrors install functions that require success

type TestingT added in v0.34.0

type TestingT interface {
	Errorf(format string, args ...interface{})
	Helper()
}

TestingT simulates assert.TestingT and assert.tHelper without adding testify as a non-test dependency.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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