MCPcopy
hub / github.com/prometheus/prometheus / TestLoadConfig

Function TestLoadConfig

config/config_test.go:2121–2139  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2119}
2120
2121func TestLoadConfig(t *testing.T) {
2122 // Parse a valid file that sets a global scrape timeout. This tests whether parsing
2123 // an overwritten default field in the global config permanently changes the default.
2124 _, err := LoadFile("testdata/global_timeout.good.yml", false, promslog.NewNopLogger())
2125 require.NoError(t, err)
2126
2127 c, err := LoadFile("testdata/conf.good.yml", false, promslog.NewNopLogger())
2128
2129 require.NoError(t, err)
2130 testutil.RequireEqualWithOptions(t, expectedConf, c, []cmp.Option{
2131 cmpopts.IgnoreUnexported(config.ProxyConfig{}),
2132 cmpopts.IgnoreUnexported(ionos.SDConfig{}),
2133 cmpopts.IgnoreUnexported(outscale.SDConfig{}),
2134 cmpopts.IgnoreUnexported(stackit.SDConfig{}),
2135 cmpopts.IgnoreUnexported(regexp.Regexp{}),
2136 cmpopts.IgnoreUnexported(hetzner.SDConfig{}),
2137 cmpopts.IgnoreUnexported(Config{}),
2138 })
2139}
2140
2141func TestScrapeIntervalLarger(t *testing.T) {
2142 c, err := LoadFile("testdata/scrape_interval_larger.good.yml", false, promslog.NewNopLogger())

Callers

nothing calls this directly

Calls 2

RequireEqualWithOptionsFunction · 0.92
LoadFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…