Documentation
¶
Index ¶
- func Command(executableName, identity string) []string
- func CreateTempDirForTest(t *testing.T, dirName string) (string, error)
- func GetFreePort(t *testing.T) (string, error)
- func RunInProcess(o *runOptions)
- func ScrapeMetrics(ctx context.Context, cfg *rest.Config, ...) error
- func ScratchDirs(t *testing.T) (string, string, error)
- func StartKcpCommand(identity string) []string
- func WaitForReady(ctx context.Context, t *testing.T, cfg *rest.Config, keepMonitoring bool) error
- func WithLogStreaming(o *runOptions)
- type Config
- type Fixture
- type Option
- type RunOption
- type RunningServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command returns the string tokens required to start the given executable in the currently configured mode (direct or via `go run`).
func CreateTempDirForTest ¶
CreateTempDirForTest creates the named directory with a unique base path derived from the name of the current test.
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use.
func RunInProcess ¶
func RunInProcess(o *runOptions)
func ScrapeMetrics ¶
func ScratchDirs ¶
ScratchDirs determines where artifacts and data should live for a test server. The passed subDir is appended to the artifact directory and should be unique to the test.
func StartKcpCommand ¶
StartKcpCommand returns the string tokens required to start kcp in the currently configured mode (direct or via `go run`).
func WaitForReady ¶
func WithLogStreaming ¶
func WithLogStreaming(o *runOptions)
Types ¶
type Config ¶
type Config struct {
Name string
Args []string
ArtifactDir string
DataDir string
ClientCADir string
LogToConsole bool
RunInProcess bool
}
Config qualify a kcp server to start
Deprecated for use outside this package. Prefer PrivateKcpServer().
type Fixture ¶
type Fixture struct {
Servers map[string]RunningServer
}
Fixture manages the lifecycle of a set of kcp servers.
Deprecated for use outside this package. Prefer PrivateKcpServer().
type Option ¶
Option a function that wish to modify a given kcp configuration.
func WithCustomArguments ¶
WithCustomArguments applies provided arguments to a given kcp configuration.
func WithScratchDirectories ¶
WithScratchDirectories adds custom scratch directories to a kcp configuration.
type RunningServer ¶
type RunningServer interface {
Name() string
KubeconfigPath() string
RawConfig() (clientcmdapi.Config, error)
BaseConfig(t *testing.T) *rest.Config
RootShardSystemMasterBaseConfig(t *testing.T) *rest.Config
ShardSystemMasterBaseConfig(t *testing.T, shard string) *rest.Config
ShardNames() []string
Artifact(t *testing.T, producer func() (runtime.Object, error))
ClientCAUserConfig(t *testing.T, config *rest.Config, name string, groups ...string) *rest.Config
CADirectory() string
}
func NewExternalKCPServer ¶
func NewExternalKCPServer(name, kubeconfigPath string, shardKubeconfigPaths map[string]string, clientCADir string) (RunningServer, error)
NewExternalKCPServer returns a RunningServer for a kubeconfig pointing to a kcp instance not managed by the test run. Since the kubeconfig is expected to exist prior to running tests against it, the configuration can be loaded synchronously and no locking is required to subsequently access it.