testutils

package
v0.0.0-...-b2ab0ea Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JwksName = "my-jwks-server"

	EmployeesIDData = `{"data":{"employees":[{"id":1},{"id":2},{"id":3},{"id":4},{"id":5},{"id":7},{"id":8},{"id":10},{"id":11},{"id":12}]}}`
)

Variables

This section is empty.

Functions

func AssertAttributeNotInSet

func AssertAttributeNotInSet(t *testing.T, set attribute.Set, attr attribute.KeyValue)

func ConfigureAuth

func ConfigureAuth(t *testing.T) ([]authentication.Authenticator, *jwks.Server)

func ConfigureAuthWithJwksConfig

func ConfigureAuthWithJwksConfig(t *testing.T, jwksConfig []authentication.JWKSConfig) []authentication.Authenticator

func GetMetricByName

func GetMetricByName(scopeMetric *metricdata.ScopeMetrics, name string) *metricdata.Metrics

func GetMetricScopeByName

func GetMetricScopeByName(metrics []metricdata.ScopeMetrics, name string) *metricdata.ScopeMetrics

func HasDataPointWithAttribute

func HasDataPointWithAttribute[N int64 | float64](dataPoints []metricdata.DataPoint[N], attr attribute.KeyValue) bool

HasDataPointWithAttribute checks if any data point in a Sum or Gauge metric has the given attribute.

func HasHistogramDataPointWithAttribute

func HasHistogramDataPointWithAttribute[N int64 | float64](dataPoints []metricdata.HistogramDataPoint[N], attr attribute.KeyValue) bool

HasHistogramDataPointWithAttribute checks if any data point in a Histogram metric has the given attribute.

func NewContextWithCancel

func NewContextWithCancel(t *testing.T) context.Context

NewContextWithCancel creates a new context with a cancel function that is called when the test is done.

func RequireSpanWithName

func RequireSpanWithName(t *testing.T, exporter *tracetest2.InMemoryExporter, name string) trace.ReadOnlySpan

func ToPtr

func ToPtr[T any](v T) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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