Skip to content

Commit

Permalink
chore(spanner): remove deprecated usages of internal/trace from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
quartzmo committed Dec 5, 2024
1 parent 8d5c3ff commit 54760dc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion spanner/test/opentelemetry/test/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ replace (
)

require (
cloud.google.com/go v0.116.0
cloud.google.com/go/spanner v1.73.0
go.opentelemetry.io/otel v1.29.0
go.opentelemetry.io/otel/sdk v1.29.0
Expand All @@ -19,6 +18,7 @@ require (

require (
cel.dev/expr v0.16.0 // indirect
cloud.google.com/go v0.116.0 // indirect
cloud.google.com/go/auth v0.11.0 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.6 // indirect
cloud.google.com/go/compute/metadata v0.5.2 // indirect
Expand Down
11 changes: 0 additions & 11 deletions spanner/test/opentelemetry/test/ot_traces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"errors"
"testing"

"cloud.google.com/go/internal/trace"
"cloud.google.com/go/spanner"
stestutil "cloud.google.com/go/spanner/internal/testutil"
"go.opentelemetry.io/otel/sdk/trace/tracetest"
Expand All @@ -33,21 +32,11 @@ import (
func TestSpannerTracesWithOpenTelemetry(t *testing.T) {
ctx := context.Background()
te := newOpenTelemetryTestExporter(false, true)
old := trace.IsOpenTelemetryTracingEnabled()
trace.SetOpenTelemetryTracingEnabledField(true)

t.Cleanup(func() {
trace.SetOpenTelemetryTracingEnabledField(old)
te.Unregister(ctx)
})

if trace.IsOpenCensusTracingEnabled() {
t.Errorf("got true, want false")
}
if !trace.IsOpenTelemetryTracingEnabled() {
t.Errorf("got false, want true")
}

minOpened := uint64(1)
server, client, teardown := setupMockedTestServerWithConfig(t, spanner.ClientConfig{
SessionPoolConfig: spanner.SessionPoolConfig{
Expand Down

0 comments on commit 54760dc

Please sign in to comment.