integration

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 70 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultIntegrationTestRetentionOpts are default integration test retention options.
	DefaultIntegrationTestRetentionOpts = retention.NewOptions().SetRetentionPeriod(6 * time.Hour)
)

Functions

This section is empty.

Types

type InitializeBootstrappersOptions added in v0.15.9

type InitializeBootstrappersOptions struct {
	CommitLogOptions commitlog.Options
	WithCommitLog    bool
	WithFileSystem   bool
}

InitializeBootstrappersOptions supplies options for bootstrapper initialization.

type TestOptions

type TestOptions interface {
	// SetNamespaces sets the namespaces.
	SetNamespaces(value []namespace.Metadata) TestOptions

	// Namespaces returns the namespaces.
	Namespaces() []namespace.Metadata

	// SetNamespaceInitializer sets the namespace initializer,
	// if this is set, it superseeds Namespaces()
	SetNamespaceInitializer(value namespace.Initializer) TestOptions

	// NamespaceInitializer returns the namespace initializer
	NamespaceInitializer() namespace.Initializer

	// SetID sets the node ID.
	SetID(value string) TestOptions

	// ID returns the node ID.
	ID() string

	// SetTickMinimumInterval sets the tick interval.
	SetTickMinimumInterval(value time.Duration) TestOptions

	// TickMinimumInterval returns the tick interval.
	TickMinimumInterval() time.Duration

	// SetHTTPClusterAddr sets the http cluster address.
	SetHTTPClusterAddr(value string) TestOptions

	// HTTPClusterAddr returns the http cluster address.
	HTTPClusterAddr() string

	// SetTChannelClusterAddr sets the tchannel cluster address.
	SetTChannelClusterAddr(value string) TestOptions

	// TChannelClusterAddr returns the tchannel cluster address.
	TChannelClusterAddr() string

	// SetHTTPNodeAddr sets the http node address.
	SetHTTPNodeAddr(value string) TestOptions

	// HTTPNodeAddr returns the http node address.
	HTTPNodeAddr() string

	// SetTChannelNodeAddr sets the tchannel node address.
	SetTChannelNodeAddr(value string) TestOptions

	// TChannelNodeAddr returns the tchannel node address.
	TChannelNodeAddr() string

	// SetHTTPDebugAddr sets the http debug address.
	SetHTTPDebugAddr(value string) TestOptions

	// HTTPDebugAddr returns the http debug address.
	HTTPDebugAddr() string

	// SetServerStateChangeTimeout sets the server state change timeout.
	SetServerStateChangeTimeout(value time.Duration) TestOptions

	// ServerStateChangeTimeout returns the server state change timeout.
	ServerStateChangeTimeout() time.Duration

	// SetClusterConnectionTimeout sets the cluster connection timeout.
	SetClusterConnectionTimeout(value time.Duration) TestOptions

	// ClusterConnectionTimeout returns the cluster connection timeout.
	ClusterConnectionTimeout() time.Duration

	// SetReadRequestTimeout sets the read request timeout.
	SetReadRequestTimeout(value time.Duration) TestOptions

	// ReadRequestTimeout returns the read request timeout.
	ReadRequestTimeout() time.Duration

	// SetWriteRequestTimeout sets the write request timeout.
	SetWriteRequestTimeout(value time.Duration) TestOptions

	// WriteRequestTimeout returns the write request timeout.
	WriteRequestTimeout() time.Duration

	// SetTruncateRequestTimeout sets the truncate request timeout.
	SetTruncateRequestTimeout(value time.Duration) TestOptions

	// TruncateRequestTimeout returns the truncate request timeout.
	TruncateRequestTimeout() time.Duration

	// SetFetchRequestTimeout sets the fetch request timeout.
	SetFetchRequestTimeout(value time.Duration) TestOptions

	// FetchRequestTimeout returns the fetch request timeout.
	FetchRequestTimeout() time.Duration

	// SetWorkerPoolSize sets the number of workers in the worker pool.
	SetWorkerPoolSize(value int) TestOptions

	// WorkerPoolSize returns the number of workers in the worker pool.
	WorkerPoolSize() int

	// SetClusterDatabaseTopologyInitializer sets the topology initializer that
	// is used when creating a cluster database
	SetClusterDatabaseTopologyInitializer(value topology.Initializer) TestOptions

	// ClusterDatabaseTopologyInitializer returns the topology initializer that
	// is used when creating a cluster database
	ClusterDatabaseTopologyInitializer() topology.Initializer

	// SetUseTChannelClientForReading sets whether we use the tchannel client for reading.
	SetUseTChannelClientForReading(value bool) TestOptions

	// UseTChannelClientForReading returns whether we use the tchannel client for reading.
	UseTChannelClientForReading() bool

	// SetUseTChannelClientForWriting sets whether we use the tchannel client for writing.
	SetUseTChannelClientForWriting(value bool) TestOptions

	// UseTChannelClientForWriting returns whether we use the tchannel client for writing.
	UseTChannelClientForWriting() bool

	// SetUseTChannelClientForTruncation sets whether we use the tchannel client for truncation.
	SetUseTChannelClientForTruncation(value bool) TestOptions

	// UseTChannelClientForTruncation returns whether we use the tchannel client for truncation.
	UseTChannelClientForTruncation() bool

	// SetDatabaseBlockRetrieverManager sets the block retriever manager to
	// use when bootstrapping retrievable blocks instead of blocks
	// containing data.
	// If you don't wish to bootstrap retrievable blocks instead of
	// blocks containing data then do not set this manager.
	// You can opt into which namespace you wish to have this enabled for
	// by returning nil instead of a result when creating a new block retriever
	// for a namespace from the manager.
	SetDatabaseBlockRetrieverManager(
		value block.DatabaseBlockRetrieverManager,
	) TestOptions

	// NewBlockRetrieverFn returns the new block retriever constructor to
	// use when bootstrapping retrievable blocks instead of blocks
	// containing data.
	DatabaseBlockRetrieverManager() block.DatabaseBlockRetrieverManager

	// SetVerifySeriesDebugFilePathPrefix sets the file path prefix for writing a debug file of series comparisons.
	SetVerifySeriesDebugFilePathPrefix(value string) TestOptions

	// VerifySeriesDebugFilePathPrefix returns the file path prefix for writing a debug file of series comparisons.
	VerifySeriesDebugFilePathPrefix() string

	// WriteConsistencyLevel returns the consistency level for writing with the m3db client.
	WriteConsistencyLevel() topology.ConsistencyLevel

	// SetWriteConsistencyLevel sets the consistency level for writing with the m3db client.
	SetWriteConsistencyLevel(value topology.ConsistencyLevel) TestOptions

	// NumShards returns the number of shards to use.
	NumShards() int

	// SetNumShards sets the number of shards to use.
	SetNumShards(value int) TestOptions

	// MaxWiredBlocks returns the maximum number of wired blocks to keep in memory using the LRU cache.
	MaxWiredBlocks() uint

	// SetMaxWiredBlocks sets the maximum number of wired blocks to keep in memory using the LRU cache.
	SetMaxWiredBlocks(value uint) TestOptions

	// SetWriteNewSeriesAsync sets whether we insert/index asynchronously.
	SetWriteNewSeriesAsync(bool) TestOptions

	// WriteNewSeriesAsync returns whether we insert/index asynchronously.
	WriteNewSeriesAsync() bool

	// SetFilePathPrefix sets the file path prefix.
	SetFilePathPrefix(value string) TestOptions

	// FilePathPrefix returns the file path prefix.
	FilePathPrefix() string

	// SetProtoEncoding turns on proto encoder.
	SetProtoEncoding(value bool) TestOptions

	// ProtoEncoding returns whether proto encoder is turned on.
	ProtoEncoding() bool

	// SetAssertTestDataEqual sets a comparator to compare two byte arrays,
	// useful for proto-encoded annotations.
	SetAssertTestDataEqual(value assertTestDataEqual) TestOptions

	// AssertTestDataEqual returns a comparator to compare two byte arrays.
	AssertTestDataEqual() assertTestDataEqual

	// SetNowFn will set the now fn.
	SetNowFn(value func() time.Time) TestOptions

	// NowFn returns the now fn.
	NowFn() func() time.Time

	// SetReportInterval sets the time between reporting metrics within the system.
	SetReportInterval(value time.Duration) TestOptions

	// ReportInterval returns the time between reporting metrics within the system.
	ReportInterval() time.Duration
}

TestOptions contains integration test options.

func NewTestOptions

func NewTestOptions(t *testing.T) TestOptions

NewTestOptions returns a new set of integration test options.

type TestSetup

type TestSetup interface {
	topology.MapProvider

	Opts() TestOptions
	SetOpts(TestOptions)
	FilesystemOpts() fs.Options
	AssertEqual(*testing.T, []generate.TestValue, []generate.TestValue) bool
	DB() cluster.Database
	Scope() tally.TestScope
	M3DBClient() client.Client
	M3DBVerificationAdminClient() client.AdminClient
	TChannelClient() *TestTChannelClient
	Namespaces() []namespace.Metadata
	TopologyInitializer() topology.Initializer
	SetTopologyInitializer(topology.Initializer)
	Fetch(req *rpc.FetchRequest) ([]generate.TestValue, error)
	FilePathPrefix() string
	StorageOpts() storage.Options
	SetStorageOpts(storage.Options)
	SetServerStorageOpts(server.StorageOptions)
	Origin() topology.Host
	ServerIsBootstrapped() bool
	StopServer() error
	StartServer() error
	StartServerDontWaitBootstrap() error
	NowFn() clock.NowFn
	SetNowFn(time.Time)
	Close()
	WriteBatch(ident.ID, generate.SeriesBlock) error
	ShouldBeEqual() bool
	// *NOTE*: This method is deprecated and should not be used in future tests.
	// Also, we should migrate existing tests when we touch them away from using this.
	SleepFor10xTickMinimumInterval()
	BlockLeaseManager() block.LeaseManager
	ShardSet() sharding.ShardSet
	SetShardSet(sharding.ShardSet)
	GeneratorOptions(retention.Options) generate.Options
	MaybeResetClients() error
	SchemaRegistry() namespace.SchemaRegistry
	NamespaceMetadataOrFail(ident.ID) namespace.Metadata
	MustSetTickMinimumInterval(time.Duration)
	WaitUntilServerIsBootstrapped() error
	WaitUntilServerIsUp() error
	WaitUntilServerIsDown() error
	Truncate(*rpc.TruncateRequest) (int64, error)
	InitializeBootstrappers(opts InitializeBootstrappersOptions) error
}

TestSetup is a test setup.

func NewTestSetup

func NewTestSetup(
	t *testing.T,
	opts TestOptions,
	fsOpts fs.Options,
	storageOptFns ...storageOption,
) (TestSetup, error)

NewTestSetup returns a new test setup for non-dockerized integration tests.

type TestTChannelClient

type TestTChannelClient struct {
	// contains filtered or unexported fields
}

TestTChannelClient is a test only TChannel client that exposes db methods.

func NewTChannelClient

func NewTChannelClient(name, address string) (*TestTChannelClient, error)

NewTChannelClient creates a new client on the given address.

func (*TestTChannelClient) Address added in v1.0.1

func (client *TestTChannelClient) Address() string

Address returns the address.

func (*TestTChannelClient) Channel added in v1.0.1

func (client *TestTChannelClient) Channel() *tchannel.Channel

Channel returns the TChannel channel.

func (*TestTChannelClient) TChannelClientFetch

func (client *TestTChannelClient) TChannelClientFetch(
	timeout time.Duration, req *rpc.FetchRequest,
) (*rpc.FetchResult_, error)

TChannelClientFetch fulfills a fetch request using a tchannel client.

func (*TestTChannelClient) TChannelClientHealth

func (client *TestTChannelClient) TChannelClientHealth(
	timeout time.Duration,
) (*rpc.NodeHealthResult_, error)

TChannelClientHealth fulfills a client health request using a tchannel client.

func (*TestTChannelClient) TChannelClientTruncate

func (client *TestTChannelClient) TChannelClientTruncate(
	timeout time.Duration, req *rpc.TruncateRequest,
) (int64, error)

TChannelClientTruncate fulfills a namespace truncation request using a tchannel client.

func (*TestTChannelClient) TChannelClientWrite

func (client *TestTChannelClient) TChannelClientWrite(
	timeout time.Duration, req *rpc.WriteRequest,
) error

TChannelClientWrite writes a datapoint using a tchannel client.

func (*TestTChannelClient) TChannelClientWriteBatch

func (client *TestTChannelClient) TChannelClientWriteBatch(
	timeout time.Duration, namespace ident.ID, seriesList generate.SeriesBlock,
) error

TChannelClientWriteBatch writes a data map using a tchannel client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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