Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Egor Redozubov committed Nov 18, 2024
1 parent 823ac9b commit 0566421
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions expr/functions/countValues/function_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ func init() {
for _, m := range md {
metadata.RegisterFunction(m.Name, m.F)
}

evaluator := th.EvaluatorFromFuncWithMetadata(metadata.FunctionMD.Functions)
metadata.SetEvaluator(evaluator)
helper.SetEvaluator(evaluator)
}

func TestCountValues(t *testing.T) {
Expand All @@ -30,7 +26,7 @@ func TestCountValues(t *testing.T) {
{
"countValues(metric1.foo.*.*)",
map[parser.MetricRequest][]*types.MetricData{
{"metric1.foo.*.*", 0, 1}: {
{Metric: "metric1.foo.*.*", From: 0, Until: 1}: {
types.MakeMetricData("metric1.foo.bar1.baz", []float64{1, 2, 3, 4, 5}, 1, now32),
types.MakeMetricData("metric1.foo.bar1.qux", []float64{2, 2, 4, 5, 6}, 1, now32),
types.MakeMetricData("metric1.foo.bar2.baz", []float64{math.NaN(), 1, 1, 1, 1}, 1, now32),
Expand All @@ -49,7 +45,7 @@ func TestCountValues(t *testing.T) {
{
"countValues(metric1.foo.*.*, 7)",
map[parser.MetricRequest][]*types.MetricData{
{"metric1.foo.*.*", 0, 1}: {
{Metric: "metric1.foo.*.*", From: 0, Until: 1}: {
types.MakeMetricData("metric1.foo.bar1.baz", []float64{1, 2, 3, 4, 5}, 1, now32),
types.MakeMetricData("metric1.foo.bar1.qux", []float64{2, 2, 4, 5, 6}, 1, now32),
types.MakeMetricData("metric1.foo.bar2.baz", []float64{math.NaN(), 1, 1, 1, 1}, 1, now32),
Expand All @@ -68,7 +64,7 @@ func TestCountValues(t *testing.T) {
{
"countValues(metric1.foo.*.*,valuesLimit=6)",
map[parser.MetricRequest][]*types.MetricData{
{"metric1.foo.*.*", 0, 1}: {
{Metric: "metric1.foo.*.*", From: 0, Until: 1}: {
types.MakeMetricData("metric1.foo.bar1.baz", []float64{1, 2, 3, 4, 5}, 1, now32),
types.MakeMetricData("metric1.foo.bar1.qux", []float64{2, 2, 4, 5, 6}, 1, now32),
types.MakeMetricData("metric1.foo.bar2.baz", []float64{math.NaN(), 1, 1, 1, 1}, 1, now32),
Expand All @@ -87,7 +83,7 @@ func TestCountValues(t *testing.T) {
{
"countValues(metric1.foo.*.*, 5)",
map[parser.MetricRequest][]*types.MetricData{
{"metric1.foo.*.*", 0, 1}: {
{Metric: "metric1.foo.*.*", From: 0, Until: 1}: {
types.MakeMetricData("metric1.foo.bar1.baz", []float64{1, 2, 3, 4, 5}, 1, now32),
types.MakeMetricData("metric1.foo.bar1.qux", []float64{2, 2, 4, 5, 6}, 1, now32),
types.MakeMetricData("metric1.foo.bar2.baz", []float64{math.NaN(), 1, 1, 1, 1}, 1, now32),
Expand All @@ -101,7 +97,7 @@ func TestCountValues(t *testing.T) {
{
"countValues(metric1.doo.*.*,valuesLimit=32)",
map[parser.MetricRequest][]*types.MetricData{
{"metric1.doo.*.*", 0, 1}: {
{Metric: "metric1.doo.*.*", From: 0, Until: 1}: {
types.MakeMetricData("metric1.doo.bar1.baz", []float64{11, 21, 31, 41, 51, 61, 71, 81, 91, 101}, 1, now32),
types.MakeMetricData("metric1.doo.bar2.baz", []float64{12, 22, 32, 42, 52, 62, 72, 82, 92, 102}, 1, now32),
types.MakeMetricData("metric1.doo.bar3.baz", []float64{13, 23, 33, 43, 53, 63, 73, 83, 93, 103}, 1, now32),
Expand Down

0 comments on commit 0566421

Please sign in to comment.