Skip to content

Commit

Permalink
Add unit test to improve coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Rayhan Hossain <[email protected]>
  • Loading branch information
hossain-rayhan committed May 5, 2021
1 parent 26560fa commit f557e60
Showing 1 changed file with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,30 @@ var (
addInt64Point(0, 3, 2).build(),
},
},
{
name: "metric_name_insert_with_match_label_strict_missing_key",
transforms: []internalTransform{
{
MetricIncludeFilter: internalFilterStrict{include: "metric1", matchLabels: map[string]string{"missing_key": "value1"}},
Action: Insert,
NewName: "new/metric1",
},
},
in: []*metricspb.Metric{
metricBuilder().setName("metric1").
setLabels([]string{"label1", "label2"}).
setDataType(metricspb.MetricDescriptor_GAUGE_INT64).
addTimeseries(1, []string{"value1", "value2"}).
addInt64Point(0, 3, 2).build(),
},
out: []*metricspb.Metric{
metricBuilder().setName("metric1").
setLabels([]string{"label1", "label2"}).
setDataType(metricspb.MetricDescriptor_GAUGE_INT64).
addTimeseries(1, []string{"value1", "value2"}).
addInt64Point(0, 3, 2).build(),
},
},
{
name: "metric_name_insert_with_match_label_regexp_missing_key",
transforms: []internalTransform{
Expand Down

0 comments on commit f557e60

Please sign in to comment.