mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
28 lines
520 B
Go
28 lines
520 B
Go
|
package tracing
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/caddyserver/caddy/v2"
|
||
|
)
|
||
|
|
||
|
func TestOpenTelemetryWrapper_newOpenTelemetryWrapper(t *testing.T) {
|
||
|
ctx, cancel := caddy.NewContext(caddy.Context{Context: context.Background()})
|
||
|
defer cancel()
|
||
|
|
||
|
var otw openTelemetryWrapper
|
||
|
var err error
|
||
|
|
||
|
if otw, err = newOpenTelemetryWrapper(ctx,
|
||
|
"",
|
||
|
); err != nil {
|
||
|
t.Errorf("newOpenTelemetryWrapper() error = %v", err)
|
||
|
t.FailNow()
|
||
|
}
|
||
|
|
||
|
if otw.propagators == nil {
|
||
|
t.Errorf("Propagators should not be empty")
|
||
|
}
|
||
|
}
|