e2e

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

README

E2E tests

go test --count 1 -v ./test/e2e/... -tags e2e

Redis tests

It is expected that a Redis server will be running locally when e2e tests are run. Redis tests can be customized using these parameters:

--redis-address my.redis.server:6379    # For using an explicit Redis server
--redis-password pA55vv04d              # To use a Redis password
--redis-stream mystream                 # To use an explicit Redis stream

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterLogs

func FilterLogs(opts ...LogFilterOption) func(observer.LoggedEntry) bool

Types

type BrokerTestRunner

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

func NewBrokerTestRunner

func NewBrokerTestRunner(ctx context.Context, t *testing.T) *BrokerTestRunner

func (*BrokerTestRunner) AddBroker

func (r *BrokerTestRunner) AddBroker(name string, port int, backend backend.Interface)

func (*BrokerTestRunner) AddConsumer

func (r *BrokerTestRunner) AddConsumer(name string, consumer lib.Consumer)

func (*BrokerTestRunner) AddProducer

func (r *BrokerTestRunner) AddProducer(name string, producer lib.Producer)

func (*BrokerTestRunner) CleanUp

func (r *BrokerTestRunner) CleanUp()

func (*BrokerTestRunner) GetBroker

func (r *BrokerTestRunner) GetBroker(name string) *ManagedBroker

func (*BrokerTestRunner) GetBrokerEndPoint

func (r *BrokerTestRunner) GetBrokerEndPoint(name string) string

func (*BrokerTestRunner) GetBrokerGlobals

func (r *BrokerTestRunner) GetBrokerGlobals(name string) *pkgcmd.Globals

func (*BrokerTestRunner) GetBrokerStatus

func (r *BrokerTestRunner) GetBrokerStatus(name string) RunnerComponentStatus

func (*BrokerTestRunner) GetLogger

func (r *BrokerTestRunner) GetLogger() *zap.Logger

func (*BrokerTestRunner) GetObservedLogs

func (r *BrokerTestRunner) GetObservedLogs() *observer.ObservedLogs

func (*BrokerTestRunner) StartBroker

func (r *BrokerTestRunner) StartBroker(name string)

func (*BrokerTestRunner) StartConsumer

func (r *BrokerTestRunner) StartConsumer(name string)

func (*BrokerTestRunner) StopBroker

func (r *BrokerTestRunner) StopBroker(name string)

func (*BrokerTestRunner) StopConsumer

func (r *BrokerTestRunner) StopConsumer(name string)

func (*BrokerTestRunner) UpdateBrokerConfig

func (r *BrokerTestRunner) UpdateBrokerConfig(name string, cfg *cfgbroker.Config)

func (*BrokerTestRunner) WaitForLogEntry

func (r *BrokerTestRunner) WaitForLogEntry(timeout time.Duration, opts ...LogFilterOption) bool

type Event

type Event string

type LogFilterOption

type LogFilterOption func(le observer.LoggedEntry) bool

func LogFilterWithField

func LogFilterWithField(field zapcore.Field) LogFilterOption

func LogFilterWithLevel

func LogFilterWithLevel(level zapcore.Level) LogFilterOption

func LogFilterWithMessage

func LogFilterWithMessage(msg string) LogFilterOption

type ManagedBroker

type ManagedBroker struct {
	Instance *broker.Instance
	Globals  *pkgcmd.Globals
	Cancel   context.CancelFunc
	Status   RunnerComponentStatus
}

type ManagedConsumer

type ManagedConsumer struct {
	Consumer lib.Consumer
	Cancel   context.CancelFunc
	Status   RunnerComponentStatus
}

type RunnerComponentStatus

type RunnerComponentStatus string
const (
	RunnerComponentStatusStopped  RunnerComponentStatus = "stopped"
	RunnerComponentStatusStarted  RunnerComponentStatus = "started"
	RunnerComponentStatusStopping RunnerComponentStatus = "stopping"
)

type Status

type Status string
const (
	StatusPending  Status = "pending"
	StatusStarted  Status = "started"
	StatusFinished Status = "finished"

	EventInit = "init"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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