Documentation
¶
Index ¶
- func AssertEtcdOpsTaskDeletedAfterTTL(ctx context.Context, g *WithT, t *testing.T, cl client.Client, ...)
- func AssertEtcdOpsTaskStateAndErrorCode(ctx context.Context, g *WithT, t *testing.T, cl client.Client, ...)
- func DeployReadyEtcd(ctx context.Context, g *WithT, t *testing.T, cl client.Client, ...) *druidv1alpha1.Etcd
- type ReconcilerTestEnv
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEtcdOpsTaskDeletedAfterTTL ¶
func AssertEtcdOpsTaskDeletedAfterTTL(ctx context.Context, g *WithT, t *testing.T, cl client.Client, etcdOpsTask *druidv1alpha1.EtcdOpsTask, expectedFinalPhase druidapicommon.LastOperationType)
assertEtcdOpsTaskDeletedAfterTTL waits for the EtcdOpsTask to be deleted after TTL expires for tasks that reached the specified phase.
func AssertEtcdOpsTaskStateAndErrorCode ¶
func AssertEtcdOpsTaskStateAndErrorCode(ctx context.Context, g *WithT, t *testing.T, cl client.Client, etcdOpsTask *druidv1alpha1.EtcdOpsTask, expectedTaskState druidv1alpha1.TaskState, expectedPhase druidapicommon.LastOperationType, expectedOperationState druidapicommon.LastOperationState, expectedErrorCode *druidapicommon.ErrorCode)
assertEtcdOpsTaskStateAndErrorCode waits for the EtcdOpsTask to reach the specified state with the expected error code (or nil for success) in the given phase.
Types ¶
type ReconcilerTestEnv ¶
type ReconcilerTestEnv struct {
ItTestEnv setup.DruidTestEnvironment
Reconciler *etcdopstask.Reconciler
}
ReconcilerTestEnv encapsulates the test environment required to test the EtcdOpsTask reconciler.
func InitializeEtcdOpsTaskReconcilerTestEnv ¶
func InitializeEtcdOpsTaskReconcilerTestEnv(t *testing.T, itTestEnv setup.DruidTestEnvironment, clientBuilder *testutils.TestClientBuilder) ReconcilerTestEnv
initializeEtcdOpsTaskReconcilerTestEnv sets up the test environment
func (*ReconcilerTestEnv) InjectHTTPClient ¶
func (env *ReconcilerTestEnv) InjectHTTPClient(httpClient *http.Client)
InjectHTTPClient injects an HTTP client into the reconciler's task handler registry for testing.
Click to show internal directories.
Click to hide internal directories.