Skip to content

Commit

Permalink
Filter expected metrics as well in CollectAndCompare
Browse files Browse the repository at this point in the history
Signed-off-by: Daria Danilenko <daria.danilenko@fluxninja.com>
  • Loading branch information
DariaKunoichi committed Oct 3, 2022
1 parent 9801a4e commit 2e14819
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions prometheus/testutil/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ func convertReaderToMetricFamily(reader io.Reader) ([]*dto.MetricFamily, error)
func compareMetricFamilies(got, expected []*dto.MetricFamily, metricNames ...string) error {
if metricNames != nil {
got = filterMetrics(got, metricNames)
expected = filterMetrics(expected, metricNames)
}

return compare(got, expected)
Expand Down

0 comments on commit 2e14819

Please sign in to comment.