From 0503204353ce7226cef1c511c79ec29d7466f676 Mon Sep 17 00:00:00 2001 From: Andreas Fuchs Date: Fri, 12 Jan 2018 15:28:41 +0100 Subject: [PATCH] Validate example config files with tests This should ensure that all our examples (not just the ones we generate config specs from) are up to date with the latest releases. --- config_test.go | 27 +++++++++++++++++++++++++++ example_host.yaml | 7 ++++--- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/config_test.go b/config_test.go index ff34607dd..5542c399f 100644 --- a/config_test.go +++ b/config_test.go @@ -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) + }) + } +} diff --git a/example_host.yaml b/example_host.yaml index 0855bf636..1ffb5f1bf 100644 --- a/example_host.yaml +++ b/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 @@ -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: ""