Browse Source

config: add test case for scrape interval larger than timeout. (#6037)

Signed-off-by: johncming <johncming@yahoo.com>
pull/6050/head
johncming 5 years ago committed by Simon Pasquier
parent
commit
8d3083e256
  1. 9
      config/config_test.go
  2. 16
      config/testdata/scrape_interval_larger.good.yml

9
config/config_test.go

@ -664,6 +664,15 @@ func TestLoadConfig(t *testing.T) {
testutil.Equals(t, expectedConf, c)
}
func TestScrapeIntervalLarger(t *testing.T) {
c, err := LoadFile("testdata/scrape_interval_larger.good.yml")
testutil.Ok(t, err)
testutil.Equals(t, 1, len(c.ScrapeConfigs))
for _, sc := range c.ScrapeConfigs {
testutil.Equals(t, true, sc.ScrapeInterval >= sc.ScrapeTimeout)
}
}
// YAML marshaling must not reveal authentication credentials.
func TestElideSecrets(t *testing.T) {
c, err := LoadFile("testdata/conf.good.yml")

16
config/testdata/scrape_interval_larger.good.yml vendored

@ -0,0 +1,16 @@
global:
scrape_interval: 15s
scrape_timeout: 15s
scrape_configs:
- job_name: prometheus
scrape_interval: 5s
dns_sd_configs:
- refresh_interval: 15s
names:
- first.dns.address.domain.com
- second.dns.address.domain.com
- names:
- first.dns.address.domain.com
Loading…
Cancel
Save