Skip to content

Commit

Permalink
update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Sep 27, 2023
1 parent 9f338ab commit dc001cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions bridge/opencensus/test/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func TestMixedAPIs(t *testing.T) {
sr := tracetest.NewSpanRecorder()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr))
tracer := tp.Tracer("mixedapitracer")
octrace.DefaultTracer = ocbridge.NewTracer(tracer)
ocbridge.InstallTraceBridge(ocbridge.WithTracerProvider(tp))

func() {
ctx := context.Background()
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestMixedAPIs(t *testing.T) {
func TestStartOptions(t *testing.T) {
sr := tracetest.NewSpanRecorder()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr))
octrace.DefaultTracer = ocbridge.NewTracer(tp.Tracer("startoptionstracer"))
ocbridge.InstallTraceBridge(ocbridge.WithTracerProvider(tp))

ctx := context.Background()
_, span := octrace.StartSpan(ctx, "OpenCensusSpan", octrace.WithSpanKind(octrace.SpanKindClient))
Expand All @@ -97,8 +97,8 @@ func TestStartOptions(t *testing.T) {
func TestStartSpanWithRemoteParent(t *testing.T) {
sr := tracetest.NewSpanRecorder()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr))
ocbridge.InstallTraceBridge(ocbridge.WithTracerProvider(tp))
tracer := tp.Tracer("remoteparent")
octrace.DefaultTracer = ocbridge.NewTracer(tracer)

ctx := context.Background()
ctx, parent := tracer.Start(ctx, "OpenTelemetrySpan1")
Expand All @@ -120,8 +120,8 @@ func TestStartSpanWithRemoteParent(t *testing.T) {
func TestToFromContext(t *testing.T) {
sr := tracetest.NewSpanRecorder()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr))
ocbridge.InstallTraceBridge(ocbridge.WithTracerProvider(tp))
tracer := tp.Tracer("tofromcontext")
octrace.DefaultTracer = ocbridge.NewTracer(tracer)

func() {
ctx := context.Background()
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestToFromContext(t *testing.T) {
func TestIsRecordingEvents(t *testing.T) {
sr := tracetest.NewSpanRecorder()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr))
octrace.DefaultTracer = ocbridge.NewTracer(tp.Tracer("isrecordingevents"))
ocbridge.InstallTraceBridge(ocbridge.WithTracerProvider(tp))

ctx := context.Background()
_, ocspan := octrace.StartSpan(ctx, "OpenCensusSpan1")
Expand All @@ -179,7 +179,7 @@ func attrsMap(s []attribute.KeyValue) map[attribute.Key]attribute.Value {
func TestSetThings(t *testing.T) {
sr := tracetest.NewSpanRecorder()
tp := sdktrace.NewTracerProvider(sdktrace.WithSpanProcessor(sr))
octrace.DefaultTracer = ocbridge.NewTracer(tp.Tracer("setthings"))
ocbridge.InstallTraceBridge(ocbridge.WithTracerProvider(tp))

ctx := context.Background()
_, ocspan := octrace.StartSpan(ctx, "OpenCensusSpan1")
Expand Down

0 comments on commit dc001cd

Please sign in to comment.