Skip to content

Commit

Permalink
Add test for partially invalid input
Browse files Browse the repository at this point in the history
  • Loading branch information
mtoffl01 committed Oct 4, 2024
1 parent 44c7621 commit aa87484
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ddtrace/tracer/option_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,18 @@ func TestWithHeaderTags(t *testing.T) {
assert.Equal(0, globalconfig.HeaderTagsLen())
})

t.Run("envvar-partially-invalid", func(t *testing.T) {
defer globalconfig.ClearHeaderTags()
t.Setenv("DD_TRACE_HEADER_TAGS", "header1,header2:")

assert := assert.New(t)
newConfig()

assert.Equal(1, globalconfig.HeaderTagsLen())
fmt.Println(globalconfig.HeaderTagMap())
assert.Equal(ext.HTTPRequestHeaders+".header1", globalconfig.HeaderTag("Header1"))
})

t.Run("env-override", func(t *testing.T) {
defer globalconfig.ClearHeaderTags()
assert := assert.New(t)
Expand Down

0 comments on commit aa87484

Please sign in to comment.