eventtestutil

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonInjectors = nject.Sequence("common",
	nject.Provide("context", context.Background),
	nject.Required(nject.Provide("Report-results", func(inner func(), t T) {
		defer func() {
			if r := recover(); r != nil {
				t.Logf("RESULT: %s FAILED w/panic", t.Name())
				panic(r)
			}
			if t.Failed() {
				t.Logf("RESULT: %s FAILED", t.Name())
			} else {
				t.Logf("RESULT: %s PASSED", t.Name())
			}
		}()
		inner()
	})),
	nject.Provide("cancel", AutoCancel),
	nject.Provide("brokers", KafkaBrokers),
)

Functions

func CatchPanic

func CatchPanic(t ntest.T)

func GetTracerConfig

func GetTracerConfig(t ntest.T) eventmodels.TracerConfig

func TracerContext

func TracerContext(ctx context.Context, t ntest.T) context.Context

TracerContext returns a context with a span inside. It is not part of the default context because we don't want to pass a context that already has a span to the library when starting consumers because then we wouldn't be able to test if logging inside consumers has a span.

func TracerProvider

func TracerProvider(t ntest.T, prefix string) eventmodels.TracerProvider

Types

type Brokers

type Brokers []string

func KafkaBrokers

func KafkaBrokers(t T) Brokers

type Cancel

type Cancel func()

func AutoCancel

func AutoCancel(ctx context.Context, t T) (context.Context, Cancel)

type Prefix

type Prefix string

type T

type T = ntest.T

Jump to

Keyboard shortcuts

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