Skip to content

Commit

Permalink
add test for WithResourceAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Boten committed Aug 6, 2020
1 parent 0d78eec commit 04c93eb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions launcher/config_test.go
Expand Up @@ -126,12 +126,18 @@ func TestDebugEnabled(t *testing.T) {
WithAccessToken("access-token-123"),
WithSpanExporterEndpoint("localhost:443"),
WithLogLevel("debug"),
WithResourceAttributes(map[string]string{
"attr1": "val1",
}),
)
defer lsOtel.Shutdown()
expected := "debug logging enabled"
if expected != logger.output[0] {
t.Errorf("\nExpected: %v\ngot: %v", expected, logger.output[0])
}
output := strings.Join(logger.output[:], ",")
assert.Contains(t, output, "debug logging enabled")
assert.Contains(t, output, "test-service")
assert.Contains(t, output, "access-token-123")
assert.Contains(t, output, "ocalhost:443")
assert.Contains(t, output, "attr1")
assert.Contains(t, output, "val1")
}

func TestDefaultConfig(t *testing.T) {
Expand Down

0 comments on commit 04c93eb

Please sign in to comment.