Skip to content

Commit

Permalink
Merge branch 'v1' into francois.mazeau/appsec-gin
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy committed Feb 10, 2022
2 parents c392982 + d4e3832 commit 9d22f81
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ddtrace/tracer/tracer_test.go
Expand Up @@ -1373,6 +1373,28 @@ func TestVersion(t *testing.T) {
})
}

func TestEnvironment(t *testing.T) {
t.Run("normal", func(t *testing.T) {
tracer, _, _, stop := startTestTracer(t, WithEnv("test"))
defer stop()

assert := assert.New(t)
sp := tracer.StartSpan("http.request").(*span)
v := sp.Meta[ext.Environment]
assert.Equal("test", v)
})

t.Run("unset", func(t *testing.T) {
tracer, _, _, stop := startTestTracer(t)
defer stop()

assert := assert.New(t)
sp := tracer.StartSpan("http.request").(*span)
_, ok := sp.Meta[ext.Environment]
assert.False(ok)
})
}

// BenchmarkConcurrentTracing tests the performance of spawning a lot of
// goroutines where each one creates a trace with a parent and a child.
func BenchmarkConcurrentTracing(b *testing.B) {
Expand Down

0 comments on commit 9d22f81

Please sign in to comment.