Documentation ¶
Overview ¶
Package test: this file contains minimum viable configurations for various objects in k8ssandra-operator to facilitate testing.
Index ¶
- Constants
- func NewCassandraDatacenter(name string, namespace string) cassdcapi.CassandraDatacenter
- func NewCreateFailingFakeClient() client.Client
- func NewFakeClient(initRuntimeObjs ...runtime.Object) (client.Client, error)
- func NewFakeClientWRestMapper() client.Client
- func NewK8ssandraCluster(name string, namespace string) k8ssandraapi.K8ssandraCluster
- func NewMedusaRestore(namespace string, localRestoreName string, remoteBackupName string, dc string, ...) *medusaapi.MedusaRestoreJob
- func NewReaper(name string, namespace string) reaperapi.Reaper
- func NewStargate(name string, namespace string) stargateapi.Stargate
- func TestSetup(t *testing.T) context.Context
- type ControllerTest
- type CreateFailingFakeClient
- type FakeManagementApiFacade
- type FakeManagementApiFactory
- func (f *FakeManagementApiFactory) NewManagementApiFacade(ctx context.Context, dc *cassdcapi.CassandraDatacenter, client client.Client, ...) (cassandra.ManagementApiFacade, error)
- func (f *FakeManagementApiFactory) SetAdapter(a ManagementApiFactoryAdapter)
- func (f *FakeManagementApiFactory) SetT(t *testing.T)
- func (f *FakeManagementApiFactory) UseDefaultAdapter()
- type ManagementApiFactoryAdapter
- type ManagementApiMethod
- type MultiClusterTestEnv
- func (e *MultiClusterTestEnv) ControllerTest(ctx context.Context, test ControllerTest) func(*testing.T)
- func (e *MultiClusterTestEnv) GetControlPlaneEnvTest() *envtest.Environment
- func (e *MultiClusterTestEnv) GetDataPlaneEnvTests() []*envtest.Environment
- func (e *MultiClusterTestEnv) Start(ctx context.Context, t *testing.T, ...) error
- func (e *MultiClusterTestEnv) Stop(t *testing.T)
- type TestEnv
- type Testable
Constants ¶
View Source
const ( EnsureKeyspaceReplication = "EnsureKeyspaceReplication" GetKeyspaceReplication = "GetKeyspaceReplication" CreateKeyspaceIfNotExists = "CreateKeyspaceIfNotExists" AlterKeyspace = "AlterKeyspace" ListKeyspaces = "ListKeyspaces" CreateTable = "CreateTable" ListTables = "ListTables" GetSchemaVersions = "GetSchemaVersions" )
Variables ¶
This section is empty.
Functions ¶
func NewCassandraDatacenter ¶
func NewCassandraDatacenter(name string, namespace string) cassdcapi.CassandraDatacenter
func NewCreateFailingFakeClient ¶ added in v1.6.0
func NewFakeClient ¶
NewFakeClient gets a fake client loaded up with a scheme that contains all the APIs used in this project.
func NewK8ssandraCluster ¶
func NewK8ssandraCluster(name string, namespace string) k8ssandraapi.K8ssandraCluster
NewK8ssandraCluster returns a minimum viable k8ssandra cluster.
func NewMedusaRestore ¶ added in v1.8.0
func NewStargate ¶
func NewStargate(name string, namespace string) stargateapi.Stargate
Types ¶
type ControllerTest ¶
type CreateFailingFakeClient ¶ added in v1.6.0
CreateFailingFakeClient is a fake client. Calls to .Create on this client will fail after `createFailsAfter` invocations.
func (CreateFailingFakeClient) Create ¶ added in v1.6.0
func (c CreateFailingFakeClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
type FakeManagementApiFacade ¶
type FakeManagementApiFacade struct {
*mocks.ManagementApiFacade
}
func NewFakeManagementApiFacade ¶
func NewFakeManagementApiFacade() *FakeManagementApiFacade
func (*FakeManagementApiFacade) GetFirstCall ¶
func (f *FakeManagementApiFacade) GetFirstCall(method ManagementApiMethod, args ...interface{}) int
func (*FakeManagementApiFacade) GetLastCall ¶
func (f *FakeManagementApiFacade) GetLastCall(method ManagementApiMethod, args ...interface{}) int
type FakeManagementApiFactory ¶
type FakeManagementApiFactory struct {
// contains filtered or unexported fields
}
func (*FakeManagementApiFactory) NewManagementApiFacade ¶
func (f *FakeManagementApiFactory) NewManagementApiFacade( ctx context.Context, dc *cassdcapi.CassandraDatacenter, client client.Client, logger logr.Logger) (cassandra.ManagementApiFacade, error)
func (*FakeManagementApiFactory) SetAdapter ¶
func (f *FakeManagementApiFactory) SetAdapter(a ManagementApiFactoryAdapter)
func (*FakeManagementApiFactory) SetT ¶ added in v1.0.0
func (f *FakeManagementApiFactory) SetT(t *testing.T)
func (*FakeManagementApiFactory) UseDefaultAdapter ¶ added in v1.0.0
func (f *FakeManagementApiFactory) UseDefaultAdapter()
type ManagementApiMethod ¶
type ManagementApiMethod string
type MultiClusterTestEnv ¶
type MultiClusterTestEnv struct { // Clients is a mapping of cluster (or k8s context) names to Client objects. Note that // these are no-cache clients as they are intended for use by the tests. Clients map[string]client.Client // NumDataPlanes is the number of data planes to create. NumDataPlanes int BeforeTest func(t *testing.T) // contains filtered or unexported fields }
func (*MultiClusterTestEnv) ControllerTest ¶
func (e *MultiClusterTestEnv) ControllerTest(ctx context.Context, test ControllerTest) func(*testing.T)
func (*MultiClusterTestEnv) GetControlPlaneEnvTest ¶
func (e *MultiClusterTestEnv) GetControlPlaneEnvTest() *envtest.Environment
func (*MultiClusterTestEnv) GetDataPlaneEnvTests ¶ added in v1.1.0
func (e *MultiClusterTestEnv) GetDataPlaneEnvTests() []*envtest.Environment
func (*MultiClusterTestEnv) Start ¶
func (e *MultiClusterTestEnv) Start(ctx context.Context, t *testing.T, initReconcilers func(mgr manager.Manager, clientCache *clientcache.ClientCache, clusters []cluster.Cluster) error) error
func (*MultiClusterTestEnv) Stop ¶
func (e *MultiClusterTestEnv) Stop(t *testing.T)
Click to show internal directories.
Click to hide internal directories.