testutils

package
v1.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBaggageStringsEqual

func AssertBaggageStringsEqual(t *testing.T, got, want string)

func AssertEqual

func AssertEqual(t *testing.T, got, want interface{}, userMessage ...interface{})

func AssertFalse

func AssertFalse(t *testing.T, condition bool, userMessage ...interface{})

func AssertNotEqual

func AssertNotEqual(t *testing.T, got, want interface{}, userMessage ...interface{})

func AssertTrue

func AssertTrue(t *testing.T, condition bool, userMessage ...interface{})

func EquateKeyValueStrings added in v0.48.0

func EquateKeyValueStrings() cmp.Option

EquateKeyValueStrings compares strings after normalizing key-value pair order. It handles query strings ("a=1&b=2"), cookie strings ("a=1; b=2"), and strings containing a URL query component such as span descriptions.

func FlushTimeout added in v0.24.0

func FlushTimeout() time.Duration

func FlushWithTimeout

func FlushWithTimeout(f interface{ FlushWithContext(context.Context) bool }, timeout time.Duration) bool

FlushWithTimeout flushes f, waiting for at most timeout.

func IsCI added in v0.24.0

func IsCI() bool

func IsRaceTest added in v0.26.0

func IsRaceTest() bool

func MergeMaps added in v0.42.0

func MergeMaps[M ~map[K]V, K comparable, V any](src ...M) M

MergeMaps merges multiple maps into a single map. If there are duplicate keys, the value from the last map takes precedence.

CC BY-SA 4.0 Oliver (https://stackoverflow.com/a/74750675/3153224)

Types

type MockTelemetryTransport added in v0.38.0

type MockTelemetryTransport struct {
	// SendFunc, when set, runs before an envelope is recorded; a non-nil error
	// rejects it. It runs without holding the mock's lock, so it may block.
	SendFunc func(context.Context, *protocol.Envelope) error
	// contains filtered or unexported fields
}

func (*MockTelemetryTransport) Close added in v0.38.0

func (m *MockTelemetryTransport) Close()

func (*MockTelemetryTransport) Configure added in v0.38.0

func (m *MockTelemetryTransport) Configure(_ interface{}) error

func (*MockTelemetryTransport) FlushWithContext added in v0.38.0

func (m *MockTelemetryTransport) FlushWithContext(_ context.Context) bool

func (*MockTelemetryTransport) GetSendCount added in v0.38.0

func (m *MockTelemetryTransport) GetSendCount() int64

func (*MockTelemetryTransport) GetSentEnvelopes added in v0.38.0

func (m *MockTelemetryTransport) GetSentEnvelopes() []*protocol.Envelope

func (*MockTelemetryTransport) Reset added in v0.38.0

func (m *MockTelemetryTransport) Reset()

func (*MockTelemetryTransport) SendEnvelope added in v0.38.0

func (m *MockTelemetryTransport) SendEnvelope(ctx context.Context, envelope *protocol.Envelope) error

Jump to

Keyboard shortcuts

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