Skip to content

Commit

Permalink
Update config test to match new prometheus common.
Browse files Browse the repository at this point in the history
Signed-off-by: SuperQ <superq@gmail.com>
  • Loading branch information
SuperQ committed Jul 25, 2022
1 parent d990526 commit 661c5df
Showing 1 changed file with 2 additions and 42 deletions.
44 changes: 2 additions & 42 deletions config/config_test.go
Expand Up @@ -855,6 +855,7 @@ func TestEmptyFieldsAndRegex(t *testing.T) {
Global: &GlobalConfig{
HTTPConfig: &commoncfg.HTTPClientConfig{
FollowRedirects: true,
EnableHTTP2: true,
},
ResolveTimeout: model.Duration(5 * time.Minute),
SMTPSmarthost: HostPort{Host: "localhost", Port: "25"},
Expand All @@ -869,48 +870,7 @@ func TestEmptyFieldsAndRegex(t *testing.T) {
},

Templates: []string{
"/etc/alertmanager/template/*.tmpl",
},
Route: &Route{
Receiver: "team-X-mails",
GroupBy: []model.LabelName{
"alertname",
"cluster",
"service",
},
GroupByStr: []string{
"alertname",
"cluster",
"service",
},
GroupByAll: false,
Routes: []*Route{
{
Receiver: "team-X-mails",
MatchRE: map[string]Regexp{
"service": regexpFoo,
},
},
},
},
Receivers: []*Receiver{
{
Name: "team-X-mails",
EmailConfigs: []*EmailConfig{
{
To: "team-X+alerts@example.org",
From: "alertmanager@example.org",
Smarthost: HostPort{Host: "localhost", Port: "25"},
HTML: "{{ template \"email.default.html\" . }}",
RequireTLS: &boolFoo,
},
},
},
},
}

// Load a non-empty configuration to ensure that all fields are overwritten.
// See https://github.com/prometheus/alertmanager/issues/1649.
https://github.com/prometheus/alertmanager/issues/1649.
_, err := LoadFile("testdata/conf.good.yml")
if err != nil {
t.Errorf("Error parsing %s: %s", "testdata/conf.good.yml", err)
Expand Down

0 comments on commit 661c5df

Please sign in to comment.