Documentation
¶
Index ¶
- Constants
- Variables
- func DumpEventsInNamespace(eventsLister EventsLister, namespace string)
- func Errorf(format string, args ...interface{})
- func ExpectNoError(err error, explain ...interface{})
- func ExpectNoErrorWithOffset(offset int, err error, explain ...interface{})
- func Failf(format string, args ...interface{})
- func FailfWithOffset(offset int, format string, args ...interface{})
- func Logf(format string, args ...interface{})
- func NewE2ELogger() common.TestLogger
- func ParseFlags()
- func RemoveCleanupAction(p CleanupActionHandle)
- func RunCleanupActions()
- func SetUpManagedFederation()
- func SetUpUnmanagedFederation()
- func Skipf(format string, args ...interface{})
- func TearDownManagedFederation()
- func TearDownUnmanagedFederation()
- func WaitForUnmanagedClusterReadiness()
- type CleanupActionHandle
- type EventsLister
- type FederationFramework
- type FederationFrameworkImpl
- type ManagedFramework
- func (f *ManagedFramework) AfterEach()
- func (f *ManagedFramework) BeforeEach()
- func (f *ManagedFramework) ClusterConfigs(userAgent string) map[string]common.TestClusterConfig
- func (f *ManagedFramework) ClusterDynamicClients(apiResource *metav1.APIResource, userAgent string) map[string]common.TestCluster
- func (f *ManagedFramework) ClusterKubeClients(userAgent string) map[string]kubeclientset.Interface
- func (f *ManagedFramework) ClusterNames(userAgent string) []string
- func (f *ManagedFramework) ControllerConfig() *util.ControllerConfig
- func (f *ManagedFramework) CrClient(userAgent string) crclientset.Interface
- func (f *ManagedFramework) FedClient(userAgent string) fedclientset.Interface
- func (f *ManagedFramework) FederationSystemNamespace() string
- func (f *ManagedFramework) KubeClient(userAgent string) kubeclientset.Interface
- func (f *ManagedFramework) KubeConfig() *restclient.Config
- func (f *ManagedFramework) Logger() common.TestLogger
- func (f *ManagedFramework) TestNamespaceName() string
- type TestContextType
- type UnmanagedFramework
- func (f *UnmanagedFramework) AfterEach()
- func (f *UnmanagedFramework) BeforeEach()
- func (f *UnmanagedFramework) ClusterConfigs(userAgent string) map[string]common.TestClusterConfig
- func (f *UnmanagedFramework) ClusterDynamicClients(apiResource *metav1.APIResource, userAgent string) map[string]common.TestCluster
- func (f *UnmanagedFramework) ClusterKubeClients(userAgent string) map[string]kubeclientset.Interface
- func (f *UnmanagedFramework) ClusterNames(userAgent string) []string
- func (f *UnmanagedFramework) ControllerConfig() *util.ControllerConfig
- func (f *UnmanagedFramework) CrClient(userAgent string) crclientset.Interface
- func (f *UnmanagedFramework) FedClient(userAgent string) fedclientset.Interface
- func (f *UnmanagedFramework) FederationSystemNamespace() string
- func (f *UnmanagedFramework) KubeClient(userAgent string) kubeclientset.Interface
- func (f *UnmanagedFramework) KubeConfig() *restclient.Config
- func (f *UnmanagedFramework) Logger() common.TestLogger
- func (f *UnmanagedFramework) TestNamespaceName() string
Constants ¶
const ( // Using the same interval as integration should be fine given the // minimal load that the apiserver is likely to be under. PollInterval = 50 * time.Millisecond // How long to try single API calls (like 'get' or 'list'). Used to prevent // transient failures from failing tests. DefaultSingleCallTimeout = 30 * time.Second )
Variables ¶
var RunId = uuid.NewUUID()
unique identifier of the e2e run
Functions ¶
func DumpEventsInNamespace ¶
func DumpEventsInNamespace(eventsLister EventsLister, namespace string)
func ExpectNoError ¶
func ExpectNoError(err error, explain ...interface{})
func ExpectNoErrorWithOffset ¶
ExpectNoErrorWithOffset checks if "err" is set, and if so, fails assertion while logging the error at "offset" levels above its caller (for example, for call chain f -> g -> ExpectNoErrorWithOffset(1, ...) error would be logged for "f").
func FailfWithOffset ¶
FailfWithOffset calls "Fail" and logs the error at "offset" levels above its caller (for example, for call chain f -> g -> FailfWithOffset(1, ...) error would be logged for "f").
func NewE2ELogger ¶
func NewE2ELogger() common.TestLogger
func ParseFlags ¶
func ParseFlags()
func RemoveCleanupAction ¶
func RemoveCleanupAction(p CleanupActionHandle)
RemoveCleanupAction removes a function that was installed by AddCleanupAction.
func RunCleanupActions ¶
func RunCleanupActions()
RunCleanupActions runs all functions installed by AddCleanupAction. It does not remove them (see RemoveCleanupAction) but it does run unlocked, so they may remove themselves.
func SetUpManagedFederation ¶
func SetUpManagedFederation()
func SetUpUnmanagedFederation ¶
func SetUpUnmanagedFederation()
func TearDownManagedFederation ¶
func TearDownManagedFederation()
func TearDownUnmanagedFederation ¶
func TearDownUnmanagedFederation()
func WaitForUnmanagedClusterReadiness ¶ added in v0.0.2
func WaitForUnmanagedClusterReadiness()
Types ¶
type CleanupActionHandle ¶
type CleanupActionHandle *int
func AddCleanupAction ¶
func AddCleanupAction(fn func()) CleanupActionHandle
AddCleanupAction installs a function that will be called in the event of the whole test being terminated. This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().
type EventsLister ¶
type FederationFramework ¶
type FederationFramework interface {
FederationFrameworkImpl
// Registering a fixture ensures it will be torn down after the
// current test has executed.
RegisterFixture(fixture managed.TestFixture)
// Setup a sync controller if necessary and return the fixture.
// This is implemented commonly to support running a sync
// controller for tests that require it.
SetUpSyncControllerFixture(typeConfig typeconfig.Interface) managed.TestFixture
// Ensure propagation of the test namespace to member clusters
EnsureTestNamespacePropagation()
// Ensure a federated namespace resource for the test namespace
// exists so that the namespace will be propagated to either all
// or no member clusters.
EnsureTestFederatedNamespace(allClusters bool) *unstructured.Unstructured
}
FederationFramework provides an interface to a test federation so that the implementation can vary without affecting tests.
func NewFederationFramework ¶
func NewFederationFramework(baseName string) FederationFramework
type FederationFrameworkImpl ¶ added in v0.0.3
type FederationFrameworkImpl interface {
BeforeEach()
AfterEach()
ControllerConfig() *util.ControllerConfig
Logger() common.TestLogger
KubeConfig() *restclient.Config
KubeClient(userAgent string) kubeclientset.Interface
FedClient(userAgent string) fedclientset.Interface
CrClient(userAgent string) crclientset.Interface
ClusterConfigs(userAgent string) map[string]common.TestClusterConfig
ClusterDynamicClients(apiResource *metav1.APIResource, userAgent string) map[string]common.TestCluster
ClusterKubeClients(userAgent string) map[string]kubeclientset.Interface
ClusterNames(userAgent string) []string
FederationSystemNamespace() string
// Name of the namespace for the current test to target
TestNamespaceName() string
// contains filtered or unexported methods
}
func NewManagedFramework ¶
func NewManagedFramework(baseName string) FederationFrameworkImpl
func NewUnmanagedFramework ¶
func NewUnmanagedFramework(baseName string) FederationFrameworkImpl
type ManagedFramework ¶
type ManagedFramework struct {
// contains filtered or unexported fields
}
func (*ManagedFramework) AfterEach ¶
func (f *ManagedFramework) AfterEach()
func (*ManagedFramework) BeforeEach ¶
func (f *ManagedFramework) BeforeEach()
func (*ManagedFramework) ClusterConfigs ¶ added in v0.0.3
func (f *ManagedFramework) ClusterConfigs(userAgent string) map[string]common.TestClusterConfig
func (*ManagedFramework) ClusterDynamicClients ¶
func (f *ManagedFramework) ClusterDynamicClients(apiResource *metav1.APIResource, userAgent string) map[string]common.TestCluster
func (*ManagedFramework) ClusterKubeClients ¶
func (f *ManagedFramework) ClusterKubeClients(userAgent string) map[string]kubeclientset.Interface
func (*ManagedFramework) ClusterNames ¶ added in v0.0.2
func (f *ManagedFramework) ClusterNames(userAgent string) []string
func (*ManagedFramework) ControllerConfig ¶ added in v0.0.3
func (f *ManagedFramework) ControllerConfig() *util.ControllerConfig
func (*ManagedFramework) CrClient ¶
func (f *ManagedFramework) CrClient(userAgent string) crclientset.Interface
func (*ManagedFramework) FedClient ¶
func (f *ManagedFramework) FedClient(userAgent string) fedclientset.Interface
func (*ManagedFramework) FederationSystemNamespace ¶ added in v0.0.2
func (f *ManagedFramework) FederationSystemNamespace() string
func (*ManagedFramework) KubeClient ¶
func (f *ManagedFramework) KubeClient(userAgent string) kubeclientset.Interface
func (*ManagedFramework) KubeConfig ¶
func (f *ManagedFramework) KubeConfig() *restclient.Config
func (*ManagedFramework) Logger ¶ added in v0.0.3
func (f *ManagedFramework) Logger() common.TestLogger
func (*ManagedFramework) TestNamespaceName ¶
func (f *ManagedFramework) TestNamespaceName() string
type TestContextType ¶
type TestContextType struct {
TestManagedFederation bool
InMemoryControllers bool
KubeConfig string
KubeContext string
FederationSystemNamespace string
ClusterNamespace string
SingleCallTimeout time.Duration
LimitedScope bool
LimitedScopeInMemoryControllers bool
WaitForFinalization bool
}
var TestContext *TestContextType = &TestContextType{}
func (*TestContextType) RunControllers ¶ added in v0.0.3
func (t *TestContextType) RunControllers() bool
type UnmanagedFramework ¶
type UnmanagedFramework struct {
Config *restclient.Config
Kubeconfig *clientcmdapi.Config
BaseName string
// contains filtered or unexported fields
}
func (*UnmanagedFramework) AfterEach ¶
func (f *UnmanagedFramework) AfterEach()
AfterEach deletes the namespace, after reading its events.
func (*UnmanagedFramework) BeforeEach ¶
func (f *UnmanagedFramework) BeforeEach()
BeforeEach checks for federation apiserver is ready and makes a namespace.
func (*UnmanagedFramework) ClusterConfigs ¶
func (f *UnmanagedFramework) ClusterConfigs(userAgent string) map[string]common.TestClusterConfig
func (*UnmanagedFramework) ClusterDynamicClients ¶
func (f *UnmanagedFramework) ClusterDynamicClients(apiResource *metav1.APIResource, userAgent string) map[string]common.TestCluster
func (*UnmanagedFramework) ClusterKubeClients ¶
func (f *UnmanagedFramework) ClusterKubeClients(userAgent string) map[string]kubeclientset.Interface
func (*UnmanagedFramework) ClusterNames ¶ added in v0.0.2
func (f *UnmanagedFramework) ClusterNames(userAgent string) []string
func (*UnmanagedFramework) ControllerConfig ¶ added in v0.0.3
func (f *UnmanagedFramework) ControllerConfig() *util.ControllerConfig
func (*UnmanagedFramework) CrClient ¶
func (f *UnmanagedFramework) CrClient(userAgent string) crclientset.Interface
func (*UnmanagedFramework) FedClient ¶
func (f *UnmanagedFramework) FedClient(userAgent string) fedclientset.Interface
func (*UnmanagedFramework) FederationSystemNamespace ¶ added in v0.0.2
func (f *UnmanagedFramework) FederationSystemNamespace() string
func (*UnmanagedFramework) KubeClient ¶
func (f *UnmanagedFramework) KubeClient(userAgent string) kubeclientset.Interface
func (*UnmanagedFramework) KubeConfig ¶
func (f *UnmanagedFramework) KubeConfig() *restclient.Config
func (*UnmanagedFramework) Logger ¶ added in v0.0.3
func (f *UnmanagedFramework) Logger() common.TestLogger
func (*UnmanagedFramework) TestNamespaceName ¶
func (f *UnmanagedFramework) TestNamespaceName() string
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string.
|
Package ginkgowrapper wraps Ginkgo Fail and Skip functions to panic with structured data instead of a constant string. |