Skip to content

Commit 515043a

Browse files
committed
chore: fix test
1 parent 0798ccc commit 515043a

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

extra/rediscmd/rediscmd_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"testing"
55

66
. "github.com/bsm/ginkgo/v2"
7-
. "github.com/bsm/ginkgo/v2/extensions/table"
87
. "github.com/bsm/gomega"
98
)
109

extra/redisotel/redisotel_test.go

-26
Original file line numberDiff line numberDiff line change
@@ -34,32 +34,6 @@ func TestNewWithTracerProvider(t *testing.T) {
3434
}
3535
}
3636

37-
func TestNewWithAttributes(t *testing.T) {
38-
provider := sdktrace.NewTracerProvider()
39-
hook := newTracingHook("", WithTracerProvider(provider), WithAttributes(semconv.NetPeerNameKey.String("localhost")))
40-
ctx, span := provider.Tracer("redis-test").Start(context.TODO(), "redis-test")
41-
cmd := redis.NewCmd(ctx, "ping")
42-
defer span.End()
43-
44-
processHook := hook.ProcessHook(func(ctx context.Context, cmd redis.Cmder) error {
45-
attrs := trace.SpanFromContext(ctx).(sdktrace.ReadOnlySpan).Attributes()
46-
if !(attrs[0] == semconv.DBSystemRedis) {
47-
t.Fatalf("expected attrs[0] to be semconv.DBSystemRedis, got: %v", attrs[0])
48-
}
49-
if !(attrs[1] == semconv.NetPeerNameKey.String("localhost")) {
50-
t.Fatalf("expected attrs[1] to be semconv.NetPeerNameKey.String(\"localhost\"), got: %v", attrs[1])
51-
}
52-
if !(attrs[2] == semconv.DBStatementKey.String("ping")) {
53-
t.Fatalf("expected attrs[2] to be semconv.DBStatementKey.String(\"ping\"), got: %v", attrs[2])
54-
}
55-
return nil
56-
})
57-
err := processHook(ctx, cmd)
58-
if err != nil {
59-
t.Fatal(err)
60-
}
61-
}
62-
6337
func TestWithDBStatement(t *testing.T) {
6438
provider := sdktrace.NewTracerProvider()
6539
hook := newTracingHook(

0 commit comments

Comments
 (0)