Skip to content

Commit

Permalink
Validate example config files with tests
Browse files Browse the repository at this point in the history
This should ensure that all our examples (not just the ones we
generate config specs from) are up to date with the latest releases.
  • Loading branch information
asf-stripe committed Jan 12, 2018
1 parent 094ac5f commit 0503204
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions config_test.go
Expand Up @@ -93,3 +93,30 @@ func TestHostname(t *testing.T) {
ReadBufferSizeBytes: defaultBufferSizeBytes,
OmitEmptyHostname: true})
}

func TestVeneurExamples(t *testing.T) {
tests := []string{
"example.yaml",
"example_host.yaml",
}
for _, elt := range tests {
test := elt
t.Run(test, func(t *testing.T) {
t.Parallel()
_, err := ReadConfig(test)
assert.NoError(t, err)
})
}
}

func TestProxyExamples(t *testing.T) {
tests := []string{"example_proxy.yaml"}
for _, elt := range tests {
test := elt
t.Run(test, func(t *testing.T) {
t.Parallel()
_, err := ReadProxyConfig(test)
assert.NoError(t, err)
})
}
}
7 changes: 4 additions & 3 deletions example_host.yaml
@@ -1,12 +1,12 @@
---
api_hostname: https://app.datadoghq.com
datadog_api_hostname: https://app.datadoghq.com
datadog_api_key: "farts"
metric_max_length: 4096
trace_max_length_bytes: 16384
flush_max_per_body: 25000
debug: true
enable_profiling: true
interval: "10s"
key: "farts"
# Numbers larger than 1 will enable the use of SO_REUSEPORT, make sure
# this is supported on your platform!
num_workers: 96
Expand All @@ -24,7 +24,8 @@ stats_address: "localhost:8125"
tags:
- "foo:bar"
- "baz:quz"
udp_address: "localhost:8126"
statsd_listen_addresses:
- "udp://localhost:8126"
#http_address: "einhorn@0"
http_address: ""

Expand Down

0 comments on commit 0503204

Please sign in to comment.