MCPcopy
hub / github.com/redis/go-redis / TestNewWithTracerProvider

Function TestNewWithTracerProvider

extra/redisotel/tracing_test.go:28–41  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestNewWithTracerProvider(t *testing.T) {
29 invoked := false
30
31 tp := providerFunc(func(name string, opts ...trace.TracerOption) trace.TracerProvider {
32 invoked = true
33 return otel.GetTracerProvider()
34 })
35
36 _ = newTracingHook("redis-hook", WithTracerProvider(tp.TracerProvider("redis-test")))
37
38 if !invoked {
39 t.Fatalf("did not call custom TraceProvider")
40 }
41}
42
43func TestWithDBStatement(t *testing.T) {
44 provider := sdktrace.NewTracerProvider()

Callers

nothing calls this directly

Calls 4

providerFuncFuncType · 0.85
newTracingHookFunction · 0.85
WithTracerProviderFunction · 0.85
TracerProviderMethod · 0.80

Tested by

no test coverage detected