Skip to content

Commit cdab347

Browse files
Egor RedozubovCivil
authored andcommitted
last try to make test works
1 parent 8bb9936 commit cdab347

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

expr/functions/countValues/function.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func New(_ string) []interfaces.FunctionMetadata {
3131

3232
const (
3333
defaultValuesLimit = 32
34-
LimitExceededMetricName = "error.too.many.values.limit.reached"
34+
LimitExceededMetricName = "valuesLimitReached"
3535
)
3636

3737
// countValues(seriesList)

expr/functions/countValues/function_test.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ import (
55
"testing"
66
"time"
77

8+
"github.com/go-graphite/carbonapi/expr/interfaces"
89
"github.com/go-graphite/carbonapi/expr/metadata"
910
"github.com/go-graphite/carbonapi/expr/types"
1011
"github.com/go-graphite/carbonapi/pkg/parser"
1112
th "github.com/go-graphite/carbonapi/tests"
1213
)
1314

15+
var (
16+
md []interfaces.FunctionMetadata = New("")
17+
)
18+
1419
func init() {
15-
md := New("")
1620
for _, m := range md {
1721
metadata.RegisterFunction(m.Name, m.F)
1822
}
@@ -90,7 +94,7 @@ func TestCountValues(t *testing.T) {
9094
},
9195
"countValues",
9296
map[string][]*types.MetricData{
93-
LimitExceededMetricName: {types.MakeMetricData(LimitExceededMetricName, []float64{0, 0, 0, 0, 0}, 1, now32)},
97+
"valuesLimitReached": {types.MakeMetricData("valuesLimitReached", []float64{0, 0, 0, 0, 0}, 1, now32)},
9498
},
9599
},
96100
{
@@ -105,15 +109,15 @@ func TestCountValues(t *testing.T) {
105109
},
106110
"countValues",
107111
map[string][]*types.MetricData{
108-
LimitExceededMetricName: {types.MakeMetricData(LimitExceededMetricName, []float64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 1, now32)},
112+
"valuesLimitReached": {types.MakeMetricData("valuesLimitReached", []float64{0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 1, now32)},
109113
},
110114
},
111115
}
112116

113117
for _, tt := range tests {
114118
t.Run(tt.Target, func(t *testing.T) {
115119
eval := th.EvaluatorFromFunc(md[0].F)
116-
th.TestEvalExprWithRange(t, eval, &tt)
120+
th.TestMultiReturnEvalExpr(t, eval, &tt)
117121
})
118122
}
119123

0 commit comments

Comments
 (0)