testing

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct{}

func (Backend) Cleanup

func (Backend) Cleanup(ctx types.Context) error

func (Backend) Deploy

func (Backend) Deploy(ctx types.TestContext) error

func (Backend) Failover

func (Backend) Failover(ctx types.TestContext) error

func (Backend) Gather added in v0.9.0

func (b Backend) Gather(
	ctx types.Context,
	clusters []*types.Cluster,
	options gathering.Options,
) <-chan gathering.Result

func (Backend) GatherS3 added in v0.14.0

func (b Backend) GatherS3(
	ctx types.Context,
	profiles []*s3.Profile,
	prefixes []string,
	outputDir string,
) <-chan s3.Result

func (Backend) Protect

func (Backend) Protect(ctx types.TestContext) error

func (Backend) Purge added in v0.9.0

func (Backend) Purge(ctx types.TestContext) error

func (Backend) Relocate

func (Backend) Relocate(ctx types.TestContext) error

func (Backend) Setup

func (Backend) Setup(ctx types.Context) error

func (Backend) Undeploy

func (Backend) Undeploy(ctx types.TestContext) error

func (Backend) Unprotect

func (Backend) Unprotect(ctx types.TestContext) error

func (Backend) Validate

func (Backend) Validate(ctx types.Context) error

type ContextFunc

type ContextFunc func(types.Context) error

type Mock

type Mock struct {
	// Operations on types.Context
	ValidateFunc ContextFunc
	SetupFunc    ContextFunc
	CleanupFunc  ContextFunc

	// Operations on types.TestContext
	DeployFunc    TestContextFunc
	UndeployFunc  TestContextFunc
	ProtectFunc   TestContextFunc
	UnprotectFunc TestContextFunc
	FailoverFunc  TestContextFunc
	RelocateFunc  TestContextFunc
	PurgeFunc     TestContextFunc

	// Handling failures.
	GatherFunc   func(ctx types.Context, clsuters []*types.Cluster, options gathering.Options) <-chan gathering.Result
	GatherS3Func func(ctx types.Context, profiles []*s3.Profile, prefixes []string, outputDir string) <-chan s3.Result
}

Mock implements the testing.Testing interface. All operations succeed without accessing the clusters. To cause operations to fail, set a function returning an error.

func (*Mock) Cleanup

func (m *Mock) Cleanup(ctx types.Context) error

func (*Mock) Deploy

func (m *Mock) Deploy(ctx types.TestContext) error

func (*Mock) Failover

func (m *Mock) Failover(ctx types.TestContext) error

func (*Mock) Gather added in v0.9.0

func (m *Mock) Gather(
	ctx types.Context,
	clusters []*types.Cluster,
	options gathering.Options,
) <-chan gathering.Result

func (*Mock) GatherS3 added in v0.14.0

func (m *Mock) GatherS3(
	ctx types.Context,
	profiles []*s3.Profile,
	prefixes []string,
	outputDir string,
) <-chan s3.Result

func (*Mock) Protect

func (m *Mock) Protect(ctx types.TestContext) error

func (*Mock) Purge added in v0.9.0

func (m *Mock) Purge(ctx types.TestContext) error

func (*Mock) Relocate

func (m *Mock) Relocate(ctx types.TestContext) error

func (*Mock) Setup

func (m *Mock) Setup(ctx types.Context) error

func (*Mock) Undeploy

func (m *Mock) Undeploy(ctx types.TestContext) error

func (*Mock) Unprotect

func (m *Mock) Unprotect(ctx types.TestContext) error

func (*Mock) Validate

func (m *Mock) Validate(ctx types.Context) error

type TestContextFunc

type TestContextFunc func(types.TestContext) error

type Testing

type Testing interface {
	// Operations on types.Context.
	Validate(types.Context) error
	Setup(types.Context) error
	Cleanup(types.Context) error

	// Operations on types.TestContext.
	Deploy(types.TestContext) error
	Undeploy(types.TestContext) error
	Protect(types.TestContext) error
	Unprotect(types.TestContext) error
	Failover(types.TestContext) error
	Relocate(types.TestContext) error
	Purge(types.TestContext) error

	// Handling failures.
	Gather(
		ctx types.Context,
		clusters []*types.Cluster,
		options gathering.Options,
	) <-chan gathering.Result
	GatherS3(
		ctx types.Context,
		profiles []*s3.Profile,
		prefixes []string,
		outputDir string,
	) <-chan s3.Result
}

Testing interface for ramenctl commands.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL