testing

package
v1.31.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TearDownFunc

type TearDownFunc func()

TearDownFunc is to be called to tear down a test server.

type TestServer

type TestServer struct {
	ClientConfig      *restclient.Config             // Rest client config
	ServerOpts        *controlplaneapiserver.Options // ServerOpts
	TearDownFn        TearDownFunc                   // TearDown function
	TmpDir            string                         // Temp Dir used, by the apiserver
	EtcdClient        *clientv3.Client               // used by tests that need to check data migrated from APIs that are no longer served
	EtcdStoragePrefix string                         // storage prefix in etcd
}

TestServer represents a running test server with everything to access it and its backing store etcd.

func StartTestServer

func StartTestServer(t ktesting.TB, instanceOptions *TestServerInstanceOptions, customFlags []string, storageConfig *storagebackend.Config) (result TestServer, err error)

StartTestServer starts an etcd server and sample-generic-controlplane and returns a TestServer struct with a tear-down func and clients to access it and its backing store.

func StartTestServerOrDie

func StartTestServerOrDie(t ktesting.TB, instanceOptions *TestServerInstanceOptions, flags []string, storageConfig *storagebackend.Config) *TestServer

StartTestServerOrDie calls StartTestServer t.Fatal if it does not succeed.

type TestServerInstanceOptions

type TestServerInstanceOptions struct {
	// SkipHealthzCheck returns without waiting for the server to become healthy.
	// Useful for testing server configurations expected to prevent /healthz from completing.
	SkipHealthzCheck bool
}

TestServerInstanceOptions Instance options the TestServer

func NewDefaultTestServerOptions

func NewDefaultTestServerOptions() *TestServerInstanceOptions

NewDefaultTestServerOptions default options for TestServer instances

Jump to

Keyboard shortcuts

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