Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Prajithp authored and prajithp13 committed May 17, 2022
1 parent bf1d89d commit 48833d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions bridge/opentracing/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"net/http"
"reflect"
"strings"
"sync"

Expand Down Expand Up @@ -497,8 +498,9 @@ func otTagsToOTelAttributesKindAndError(tags map[string]interface{}) ([]attribut
for k, v := range tags {
switch k {
case string(otext.SpanKind):
if s, ok := v.(otext.SpanKindEnum); ok {
switch strings.ToLower(string(s)) {
refValue := reflect.ValueOf(v)
if refValue.Kind() == reflect.String {
switch strings.ToLower(refValue.String()) {
case "client":
kind = trace.SpanKindClient
case "server":
Expand Down
3 changes: 2 additions & 1 deletion bridge/opentracing/mix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"testing"

ot "github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"

"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
Expand Down Expand Up @@ -637,7 +638,7 @@ func runOtelOTOtel(t *testing.T, ctx context.Context, name string, callback func

func runOTOtelOT(t *testing.T, ctx context.Context, name string, callback func(*testing.T, context.Context) context.Context) {
tr := otel.Tracer("")
span, ctx := ot.StartSpanFromContext(ctx, fmt.Sprintf("%s_OT_OtelOT", name), ot.Tag{Key: "span.kind", Value: "client"})
span, ctx := ot.StartSpanFromContext(ctx, fmt.Sprintf("%s_OT_OtelOT", name), ot.Tag{Key: "span.kind", Value: ext.SpanKindRPCClient.Value})
defer span.Finish()
ctx = callback(t, ctx)
func(ctx2 context.Context) {
Expand Down

0 comments on commit 48833d7

Please sign in to comment.