prober

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 32 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// FIXME: Interval is set to 200 msec, as lower values will result in errors: knative/eventing#2357
	// Interval = 10 * time.Millisecond
	Interval = 200 * time.Millisecond
)

Functions

func AssertEventProber

func AssertEventProber(ctx context.Context, t *testing.T, prober Prober)

AssertEventProber will send finish event and then verify if all events propagated well

Types

type Config

type Config struct {
	Wathola
	Namespace     string
	Interval      time.Duration
	FinishedSleep time.Duration
	Serving       ServingConfig
	FailOnErrors  bool
	OnDuplicate   DuplicateAction
	BrokerOpts    []resources.BrokerV1Beta1Option
}

Config represents a configuration for prober.

func NewConfig

func NewConfig(namespace string) *Config

NewConfig creates a new configuration object with default values filled in. Values can be influenced by kelseyhightower/envconfig with `e2e_upgrade_tests` prefix.

type ConfigMap added in v0.19.0

type ConfigMap struct {
	// ConfigTemplate is a template file that will be compiled to the configmap
	ConfigTemplate   string
	ConfigMapName    string
	ConfigMountPoint string
	ConfigFilename   string
}

ConfigMap represents options of wathola config toml file.

type DuplicateAction added in v0.20.0

type DuplicateAction string

DuplicateAction is the action to take in case of duplicated events

const (
	Silence DuplicateAction = "silence"
	Warn    DuplicateAction = "warn"
	Error   DuplicateAction = "error"
)

type Prober

type Prober interface {
	// Verify will verify prober state after finished has been send
	Verify(ctx context.Context) ([]error, int)

	// Finish send finished event
	Finish(ctx context.Context)

	// ReportErrors will reports found errors in proper way
	ReportErrors(t *testing.T, errors []error)
	// contains filtered or unexported methods
}

Prober is the interface for a prober, which checks the result of the probes when stopped.

func RunEventProber

func RunEventProber(ctx context.Context, log *zap.SugaredLogger, client *testlib.Client, config *Config) Prober

RunEventProber starts a single Prober of the given domain.

type Report

type Report struct {
	State  string   `json:"state"`
	Events int      `json:"events"`
	Thrown []string `json:"thrown"`
}

Report represents a receiver JSON report

type ServingConfig

type ServingConfig struct {
	Use         bool
	ScaleToZero bool
}

ServingConfig represents a options for serving test component (wathola-forwarder).

type Wathola added in v0.19.0

type Wathola struct {
	ConfigMap
	EventsTypePrefix string
	HealthEndpoint   string
	BrokerName       string
}

Wathola represents options related strictly to wathola testing tool.

Directories

Path Synopsis
wathola

Jump to

Keyboard shortcuts

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