Documentation
¶
Index ¶
- Variables
- func GoleakWithDefaults(tb testing.TB, in ...goleak.Option)
- type InProcessServer
- func (s *InProcessServer) Artifact(t kcptestingserver.TestingT, producer func() (runtime.Object, error))
- func (s *InProcessServer) BaseConfig(t kcptestingserver.TestingT) *rest.Config
- func (s *InProcessServer) CADirectory() string
- func (s *InProcessServer) ClientCAUserConfig(t kcptestingserver.TestingT, config *rest.Config, name string, ...) *rest.Config
- func (s *InProcessServer) KubeconfigPath() string
- func (s *InProcessServer) Name() string
- func (s *InProcessServer) RESTConfig(t kcptestingserver.TestingT, context string) *rest.Config
- func (s *InProcessServer) RawConfig() (clientcmdapi.Config, error)
- func (s *InProcessServer) RawConfigFatal(t kcptestingserver.TestingT) clientcmdapi.Config
- func (s *InProcessServer) RootShardSystemMasterBaseConfig(t kcptestingserver.TestingT) *rest.Config
- func (s *InProcessServer) ShardNames() []string
- func (s *InProcessServer) ShardSystemMasterBaseConfig(t kcptestingserver.TestingT, shard string) *rest.Config
- func (s *InProcessServer) Start(ctx context.Context, t kcptestingserver.TestingT)
- func (s *InProcessServer) Stop()
- func (s *InProcessServer) Stopped() bool
- func (s *InProcessServer) Wait(t kcptestingserver.TestingT)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( KnownGoroutineLeaks = []goleak.Option{ goleak.IgnoreTopFunction("context.(*cancelCtx).propagateCancel.func2"), goleak.IgnoreTopFunction("google.golang.org/grpc.(*addrConn).resetTransportAndUnlock"), goleak.IgnoreTopFunction("google.golang.org/grpc.(*pickerWrapper).pick"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/grpcsync.(*CallbackSerializer).run"), goleak.IgnoreTopFunction("google.golang.org/grpc.newClientStreamWithParams.func4"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*serverHandlerTransport).HandleStreams.func1"), goleak.IgnoreTopFunction("google.golang.org/grpc.newClientStreamWithParams.func4"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*controlBuffer).get"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*http2Client).keepalive"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*recvBufferReader).readMessageHeader"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*recvBufferReader).readMessageHeaderClient"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*serverHandlerTransport).HandleStreams.func1"), goleak.IgnoreTopFunction("google.golang.org/grpc/internal/transport.(*serverHandlerTransport).runStream"), goleak.IgnoreTopFunction("internal/poll.runtime_pollWait"), goleak.IgnoreTopFunction("sync.runtime_notifyListWait"), goleak.IgnoreTopFunction("go.etcd.io/etcd/client/v3.(*watchGrpcStream).waitCancelSubstreams.func1.1"), goleak.IgnoreTopFunction("go.etcd.io/etcd/client/v3.(*watchGrpcStream).serveSubstream.func1"), goleak.IgnoreTopFunction("k8s.io/apimachinery/pkg/util/wait.BackoffUntil"), goleak.IgnoreTopFunction("github.com/kcp-dev/kcp/pkg/informer.NewGenericDiscoveringDynamicSharedInformerFactory[...].func3"), goleak.IgnoreTopFunction("k8s.io/apiserver/pkg/storage/storagebackend/factory.newETCD3Check.func2"), goleak.IgnoreTopFunction("k8s.io/client-go/util/workqueue.(*delayingType[...]).waitingLoop"), goleak.IgnoreTopFunction("k8s.io/client-go/util/workqueue.(*Typed[...]).updateUnfinishedWorkLoop"), goleak.IgnoreTopFunction("github.com/kcp-dev/apimachinery/v2/third_party/informers.newScopedSharedIndexInformerWithContext.func1"), goleak.IgnoreTopFunction("net/http.(*persistConn).writeLoop"), goleak.IgnoreTopFunction("golang.org/x/net/http2.(*serverConn).serve"), goleak.IgnoreTopFunction("gopkg.in/natefinch/lumberjack%2ev2.(*Logger).millRun"), goleak.IgnoreTopFunction("internal/poll.runtime_pollWait"), } // 14s as etcd sets a client request timeout of up to 7 seconds when // shutting down the server and then starts shutting down everything // else. // A shorter timespan d would lead to false positives in the tests. WaitTime = 14 * time.Second )
View Source
var ContextRunInProcess kcptestingserver.KcpRunner = func(ctx context.Context, t kcptestingserver.TestingT, cfg kcptestingserver.Config) (<-chan struct{}, error) { s := NewInProcessServer(t) s.Config = cfg s.Start(ctx, t) s.Wait(t) return s.StopCh, nil }
Functions ¶
Types ¶
type InProcessServer ¶
type InProcessServer struct {
Config kcptestingserver.Config
Server *kcpserver.Server
StopCh chan struct{}
ClientConfig clientcmd.ClientConfig
// contains filtered or unexported fields
}
func NewInProcessServer ¶
func NewInProcessServer(t kcptestingserver.TestingT, opts ...kcptestingserver.Option) *InProcessServer
func StartTestServer ¶
func StartTestServer(t kcptestingserver.TestingT, opts ...kcptestingserver.Option) (*InProcessServer, kcpclientset.ClusterInterface, kcpkubernetesclientset.ClusterInterface)
StartTestServer starts a KCP server for testing purposes.
func (*InProcessServer) Artifact ¶
func (s *InProcessServer) Artifact(t kcptestingserver.TestingT, producer func() (runtime.Object, error))
func (*InProcessServer) BaseConfig ¶
func (s *InProcessServer) BaseConfig(t kcptestingserver.TestingT) *rest.Config
func (*InProcessServer) CADirectory ¶
func (s *InProcessServer) CADirectory() string
func (*InProcessServer) ClientCAUserConfig ¶
func (s *InProcessServer) ClientCAUserConfig(t kcptestingserver.TestingT, config *rest.Config, name string, groups ...string) *rest.Config
func (*InProcessServer) KubeconfigPath ¶
func (s *InProcessServer) KubeconfigPath() string
func (*InProcessServer) Name ¶
func (s *InProcessServer) Name() string
func (*InProcessServer) RESTConfig ¶
func (s *InProcessServer) RESTConfig(t kcptestingserver.TestingT, context string) *rest.Config
func (*InProcessServer) RawConfig ¶
func (s *InProcessServer) RawConfig() (clientcmdapi.Config, error)
func (*InProcessServer) RawConfigFatal ¶
func (s *InProcessServer) RawConfigFatal(t kcptestingserver.TestingT) clientcmdapi.Config
func (*InProcessServer) RootShardSystemMasterBaseConfig ¶
func (s *InProcessServer) RootShardSystemMasterBaseConfig(t kcptestingserver.TestingT) *rest.Config
func (*InProcessServer) ShardNames ¶
func (s *InProcessServer) ShardNames() []string
func (*InProcessServer) ShardSystemMasterBaseConfig ¶
func (s *InProcessServer) ShardSystemMasterBaseConfig(t kcptestingserver.TestingT, shard string) *rest.Config
func (*InProcessServer) Start ¶
func (s *InProcessServer) Start(ctx context.Context, t kcptestingserver.TestingT)
func (*InProcessServer) Stop ¶
func (s *InProcessServer) Stop()
func (*InProcessServer) Stopped ¶
func (s *InProcessServer) Stopped() bool
func (*InProcessServer) Wait ¶
func (s *InProcessServer) Wait(t kcptestingserver.TestingT)
Click to show internal directories.
Click to hide internal directories.