From ec015ec6bb9737f479e99f4657feca1b939e3149 Mon Sep 17 00:00:00 2001 From: Chris Hoffman <99742+chrishoffman@users.noreply.github.com> Date: Fri, 15 Feb 2019 12:06:20 -0500 Subject: [PATCH] fixing command server tests (#6242) --- command/server/config_test.go | 33 +++++++++++-------- command/server/test-fixtures/config2.hcl | 1 + command/server/test-fixtures/config2.hcl.json | 3 +- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/command/server/config_test.go b/command/server/config_test.go index ccb9af66fd..dc6f345a41 100644 --- a/command/server/config_test.go +++ b/command/server/config_test.go @@ -48,11 +48,12 @@ func TestLoadConfigFile(t *testing.T) { }, Telemetry: &Telemetry{ - StatsdAddr: "bar", - StatsiteAddr: "foo", - DisableHostname: false, - DogStatsDAddr: "127.0.0.1:7254", - DogStatsDTags: []string{"tag_1:val_1", "tag_2:val_2"}, + StatsdAddr: "bar", + StatsiteAddr: "foo", + DisableHostname: false, + DogStatsDAddr: "127.0.0.1:7254", + DogStatsDTags: []string{"tag_1:val_1", "tag_2:val_2"}, + PrometheusRetentionTime: prometheusDefaultRetentionTime, }, DisableCache: true, @@ -121,11 +122,13 @@ func TestLoadConfigFile_topLevel(t *testing.T) { }, Telemetry: &Telemetry{ - StatsdAddr: "bar", - StatsiteAddr: "foo", - DisableHostname: false, - DogStatsDAddr: "127.0.0.1:7254", - DogStatsDTags: []string{"tag_1:val_1", "tag_2:val_2"}, + StatsdAddr: "bar", + StatsiteAddr: "foo", + DisableHostname: false, + DogStatsDAddr: "127.0.0.1:7254", + DogStatsDTags: []string{"tag_1:val_1", "tag_2:val_2"}, + PrometheusRetentionTime: 30 * time.Second, + PrometheusRetentionTimeRaw: "30s", }, DisableCache: true, @@ -202,6 +205,7 @@ func TestLoadConfigFile_json(t *testing.T) { CirconusCheckTags: "", CirconusBrokerID: "", CirconusBrokerSelectTag: "", + PrometheusRetentionTime: prometheusDefaultRetentionTime, }, MaxLeaseTTL: 10 * time.Hour, @@ -288,6 +292,8 @@ func TestLoadConfigFile_json2(t *testing.T) { CirconusCheckTags: "cat1:tag1,cat2:tag2", CirconusBrokerID: "0", CirconusBrokerSelectTag: "dc:sfo", + PrometheusRetentionTime: 30 * time.Second, + PrometheusRetentionTimeRaw: "30s", }, } if !reflect.DeepEqual(config, expected) { @@ -336,9 +342,10 @@ func TestLoadConfigDir(t *testing.T) { EnableRawEndpoint: true, Telemetry: &Telemetry{ - StatsiteAddr: "qux", - StatsdAddr: "baz", - DisableHostname: true, + StatsiteAddr: "qux", + StatsdAddr: "baz", + DisableHostname: true, + PrometheusRetentionTime: prometheusDefaultRetentionTime, }, MaxLeaseTTL: 10 * time.Hour, diff --git a/command/server/test-fixtures/config2.hcl b/command/server/test-fixtures/config2.hcl index c757d1f629..b57f89f2d5 100644 --- a/command/server/test-fixtures/config2.hcl +++ b/command/server/test-fixtures/config2.hcl @@ -26,6 +26,7 @@ telemetry { statsite_address = "foo" dogstatsd_addr = "127.0.0.1:7254" dogstatsd_tags = ["tag_1:val_1", "tag_2:val_2"] + prometheus_retention_time = "30s" } max_lease_ttl = "10h" diff --git a/command/server/test-fixtures/config2.hcl.json b/command/server/test-fixtures/config2.hcl.json index 749be58fdf..e85e390f7c 100644 --- a/command/server/test-fixtures/config2.hcl.json +++ b/command/server/test-fixtures/config2.hcl.json @@ -42,6 +42,7 @@ "circonus_check_display_name": "node1:vault", "circonus_check_tags": "cat1:tag1,cat2:tag2", "circonus_broker_id": "0", - "circonus_broker_select_tag": "dc:sfo" + "circonus_broker_select_tag": "dc:sfo", + "prometheus_retention_time": "30s" } }