|
|
@ -321,7 +321,7 @@ Outer:
|
|
|
|
got, err := query(suite.Context(), testCase.Expr, mint.Add(testCase.EvalTime),
|
|
|
|
got, err := query(suite.Context(), testCase.Expr, mint.Add(testCase.EvalTime),
|
|
|
|
suite.QueryEngine(), suite.Queryable())
|
|
|
|
suite.QueryEngine(), suite.Queryable())
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
errs = append(errs, errors.Errorf(" expr:'%s', time:%s, err:%s", testCase.Expr,
|
|
|
|
errs = append(errs, errors.Errorf(" expr: %q, time: %s, err: %s", testCase.Expr,
|
|
|
|
testCase.EvalTime.String(), err.Error()))
|
|
|
|
testCase.EvalTime.String(), err.Error()))
|
|
|
|
continue
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -338,7 +338,8 @@ Outer:
|
|
|
|
for _, s := range testCase.ExpSamples {
|
|
|
|
for _, s := range testCase.ExpSamples {
|
|
|
|
lb, err := promql.ParseMetric(s.Labels)
|
|
|
|
lb, err := promql.ParseMetric(s.Labels)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
errs = append(errs, errors.Errorf(" expr:'%s', time:%s, err:%s", testCase.Expr,
|
|
|
|
err = errors.Wrapf(err, "labels %q", s.Labels)
|
|
|
|
|
|
|
|
errs = append(errs, errors.Errorf(" expr: %q, time: %s, err: %s", testCase.Expr,
|
|
|
|
testCase.EvalTime.String(), err.Error()))
|
|
|
|
testCase.EvalTime.String(), err.Error()))
|
|
|
|
continue Outer
|
|
|
|
continue Outer
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -355,7 +356,7 @@ Outer:
|
|
|
|
return labels.Compare(gotSamples[i].Labels, gotSamples[j].Labels) <= 0
|
|
|
|
return labels.Compare(gotSamples[i].Labels, gotSamples[j].Labels) <= 0
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if !reflect.DeepEqual(expSamples, gotSamples) {
|
|
|
|
if !reflect.DeepEqual(expSamples, gotSamples) {
|
|
|
|
errs = append(errs, errors.Errorf(" expr:'%s', time:%s, \n exp:%#v, \n got:%#v", testCase.Expr,
|
|
|
|
errs = append(errs, errors.Errorf(" expr: %q, time: %s,\n exp:%#v\n got:%#v", testCase.Expr,
|
|
|
|
testCase.EvalTime.String(), parsedSamplesString(expSamples), parsedSamplesString(gotSamples)))
|
|
|
|
testCase.EvalTime.String(), parsedSamplesString(expSamples), parsedSamplesString(gotSamples)))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -510,7 +511,7 @@ func parsedSamplesString(pss []parsedSample) string {
|
|
|
|
return "nil"
|
|
|
|
return "nil"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
s := pss[0].String()
|
|
|
|
s := pss[0].String()
|
|
|
|
for _, ps := range pss[0:] {
|
|
|
|
for _, ps := range pss[1:] {
|
|
|
|
s += ", " + ps.String()
|
|
|
|
s += ", " + ps.String()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return s
|
|
|
|
return s
|
|
|
|