config: add test case for scrape interval larger than timeout. (#6037)
Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
parent
31a8ac3219
commit
8d3083e256
|
@ -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")
|
||||
|
|
|
@ -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…
Reference in New Issue