package apitesting
import "k8s.io/apimachinery/pkg/api/apitesting"
Index ¶
- func Close(t TestingT, c io.Closer)
- func CloseNoOp(TestingT, io.Closer)
- func SchemeForInstallOrDie(installFns ...InstallOrDieFunc) (*runtime.Scheme, runtimeserializer.CodecFactory)
- func SchemeForOrDie(installFns ...InstallFunc) (*runtime.Scheme, runtimeserializer.CodecFactory)
- func TestCodec(codecs runtimeserializer.CodecFactory, gvs ...schema.GroupVersion) runtime.Codec
- func TestStorageCodec(codecs runtimeserializer.CodecFactory, gvs ...schema.GroupVersion) runtime.Codec
- type InstallFunc
- type InstallOrDieFunc
- type TestingT
Functions ¶
func Close ¶
Close and fail the test if it returns an error.
func CloseNoOp ¶
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 ¶
func TestCodec(codecs runtimeserializer.CodecFactory, gvs ...schema.GroupVersion) runtime.Codec
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 ¶
InstallFunc mirrors install functions that can return an error
type InstallOrDieFunc ¶
InstallOrDieFunc mirrors install functions that require success
type TestingT ¶
type TestingT interface { Errorf(format string, args ...interface{}) Helper() }
TestingT simulates assert.TestingT and assert.tHelper without adding testify as a non-test dependency.
Source Files ¶
close.go codec.go
Directories ¶
Path | Synopsis |
---|---|
pkg/api/apitesting/fuzzer | |
pkg/api/apitesting/naming | |
pkg/api/apitesting/roundtrip |
- Version
- v0.34.0-alpha.1
- Published
- Jun 12, 2025
- Platform
- js/wasm
- Imports
- 9 packages
- Last checked
- 4 hours ago –
Tools for package owners.