Skip to content

Commit

Permalink
pkg/prometheus/promcfg_test.go: Update test assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
slashpai committed Sep 27, 2021
1 parent 04e21ed commit ac97b0a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/prometheus/promcfg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5883,6 +5883,15 @@ alerting:
nil,
)

expectErr := tc.expected == ""
if expectErr && err == nil {
t.Fatal("prometheus config generation should return an error")
}

if !expectErr && err != nil {
t.Fatal("prometheus config generation should not return an error")
}

result := string(cfg)
if tc.expected != result {
t.Logf("\n%s", pretty.Compare(tc.expected, result))
Expand Down

0 comments on commit ac97b0a

Please sign in to comment.