Documentation
¶
Overview ¶
Package testutil provides test-only helpers for integration scenarios and OpenTelemetry assertions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RequireNetworkIntegration ¶
RequireNetworkIntegration marks the test as a network integration scenario and skips it unless the dedicated env flag is enabled.
Types ¶
type OTelRecorder ¶
type OTelRecorder struct {
// contains filtered or unexported fields
}
OTelRecorder captures OpenTelemetry spans and logs for assertion in tests.
func InstallOTelRecorder ¶
func InstallOTelRecorder(t testing.TB) *OTelRecorder
InstallOTelRecorder sets up a global OpenTelemetry recorder for the duration of the test. It replaces the global tracer and logger providers and restores them during test cleanup.
func (*OTelRecorder) FindLog ¶
func (r *OTelRecorder) FindLog(body string) (RecordedLog, bool)
FindLog searches for a captured log by its body content.
func (*OTelRecorder) FindSpan ¶
func (r *OTelRecorder) FindSpan(name string) (RecordedSpan, bool)
FindSpan searches for a captured span by name.
type RecordedLog ¶
RecordedLog represents a log entry captured during testing.
Click to show internal directories.
Click to hide internal directories.