test

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Certificates

func Certificates(t T) (clientCert, clientKey, caCert string)

func ConfigMap

func ConfigMap() map[string]string

func ConfigWithIntegrationTestOptions

func ConfigWithIntegrationTestOptions(cfg common.Config) common.Config

func Consume

func Consume(t T, servers []string, topic string, limit int) []*kgo.Record

func CreateTopics added in v0.8.0

func CreateTopics(t T, servers []string, topics []string)

func DestinationConfigMap

func DestinationConfigMap(t T) map[string]string

func GenerateFranzRecords

func GenerateFranzRecords(from, to int, topicOpt ...string) []*kgo.Record

func GenerateSDKRecords

func GenerateSDKRecords(from, to int, topicOpt ...string) []sdk.Record

func ParseConfigMap

func ParseConfigMap[C any](t T, cfg map[string]string) C

func Produce

func Produce(t T, servers []string, topic string, records []*kgo.Record, timeoutOpt ...time.Duration)

func SourceConfigMap

func SourceConfigMap(t T, multipleTopics bool) map[string]string

Types

type T

type T interface {
	// Fail indicates that the test has failed but
	// allowed execution to continue.
	Fail()
	// FailNow indicates that the test has failed and
	// aborts the test.
	FailNow()
	// Name returns the name of the running (sub-) test or benchmark.
	Name() string
	// Logf formats its arguments according to the format, analogous to Printf, and
	// records the text in the error log.
	Logf(string, ...any)
	// Cleanup registers a function to be called when the test (or subtest) and all its
	// subtests complete. Cleanup functions will be called in last added,
	// first called order.
	Cleanup(func())
}

T reports when failures occur. testing.T and testing.B implement this interface.

Jump to

Keyboard shortcuts

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