Documentation
¶
Index ¶
- func FilterMetrics(rm metricdata.ResourceMetrics, name string) []metricdata.Metrics
- func RandomShortSocketName() string
- func SetupTelemetry(t *testing.T) (*tracetest.SpanRecorder, *metric.ManualReader)
- func TestLogger(t *testing.T) logging.Logger
- func TestLoggerCtx(t *testing.T) context.Context
- func WaitForClosedWithTimeout(in <-chan struct{}) error
- func WaitForErrorWithTimeout(in <-chan error) error
- func WaitForWithExplicitTimeoutV[T any](ch <-chan T, timeout time.Duration) (T, error)
- func WaitForWithTimeoutV[T any](ch <-chan T) (T, error)
- type MockResolver
- type TestTracker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterMetrics ¶
func FilterMetrics(rm metricdata.ResourceMetrics, name string) []metricdata.Metrics
func RandomShortSocketName ¶
func RandomShortSocketName() string
RandomShortSocketName creates a socket name string that avoids common pitfalls in tests. There are a bunch of opposing problems in unit tests with sockets: Ideally, we'd like to use t.TmpDir+something.sock -> too long socket name We can't just use local short file name -> clashes when running tests in parallel We can't use t.ChDir + short name -> t.ChDir does not allow t.Parallel -> we use a short local but randomized socket path
func SetupTelemetry ¶
func SetupTelemetry(t *testing.T) (*tracetest.SpanRecorder, *metric.ManualReader)
func WaitForClosedWithTimeout ¶
func WaitForClosedWithTimeout(in <-chan struct{}) error
func WaitForErrorWithTimeout ¶
func WaitForWithTimeoutV ¶
Types ¶
type MockResolver ¶
func (MockResolver) GetSecrets ¶
type TestTracker ¶
func NewTestTracker ¶
func NewTestTracker() TestTracker
Click to show internal directories.
Click to hide internal directories.