tracing: add minimal test

This commit is contained in:
2024-01-19 22:48:14 -08:00
parent 4f6b09200f
commit 232a6f98df
2 changed files with 22 additions and 4 deletions

22
tracing/tracing_test.go Normal file
View File

@@ -0,0 +1,22 @@
package tracing
import (
"context"
"os"
"testing"
)
func TestInit(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
os.Setenv("OTEL_EXPORTER_OTLP_ENDPOINT", "localhost")
shutdownFn, err := InitTracer(ctx, &TracerConfig{})
if err != nil {
t.FailNow()
}
defer shutdownFn(ctx)
}