Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Jan 30, 2023
1 parent 0798ccc commit 515043a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion extra/rediscmd/rediscmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"testing"

. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/ginkgo/v2/extensions/table"
. "github.com/bsm/gomega"
)

Expand Down
26 changes: 0 additions & 26 deletions extra/redisotel/redisotel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,32 +34,6 @@ func TestNewWithTracerProvider(t *testing.T) {
}
}

func TestNewWithAttributes(t *testing.T) {
provider := sdktrace.NewTracerProvider()
hook := newTracingHook("", WithTracerProvider(provider), WithAttributes(semconv.NetPeerNameKey.String("localhost")))
ctx, span := provider.Tracer("redis-test").Start(context.TODO(), "redis-test")
cmd := redis.NewCmd(ctx, "ping")
defer span.End()

processHook := hook.ProcessHook(func(ctx context.Context, cmd redis.Cmder) error {
attrs := trace.SpanFromContext(ctx).(sdktrace.ReadOnlySpan).Attributes()
if !(attrs[0] == semconv.DBSystemRedis) {
t.Fatalf("expected attrs[0] to be semconv.DBSystemRedis, got: %v", attrs[0])
}
if !(attrs[1] == semconv.NetPeerNameKey.String("localhost")) {
t.Fatalf("expected attrs[1] to be semconv.NetPeerNameKey.String(\"localhost\"), got: %v", attrs[1])
}
if !(attrs[2] == semconv.DBStatementKey.String("ping")) {
t.Fatalf("expected attrs[2] to be semconv.DBStatementKey.String(\"ping\"), got: %v", attrs[2])
}
return nil
})
err := processHook(ctx, cmd)
if err != nil {
t.Fatal(err)
}
}

func TestWithDBStatement(t *testing.T) {
provider := sdktrace.NewTracerProvider()
hook := newTracingHook(
Expand Down

0 comments on commit 515043a

Please sign in to comment.