Fix promql tests

Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
This commit is contained in:
Tobias Guggenmos 2020-02-03 18:51:19 +01:00
parent 1360f9ff12
commit 273ea9093a
3 changed files with 6 additions and 5 deletions

View File

@ -22,6 +22,7 @@ import (
"time"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/promql/parser"
"github.com/prometheus/prometheus/util/teststorage"
)

View File

@ -605,7 +605,7 @@ load 10s
}
testutil.Ok(t, res.Err)
testutil.Equals(t, c.Result, res.parser.Value)
testutil.Equals(t, c.Result, res.Value)
}
}
@ -823,7 +823,7 @@ load 10s
res := qry.Exec(test.Context())
testutil.Equals(t, c.Result.Err, res.Err)
testutil.Equals(t, c.Result.parser.Value, res.parser.Value)
testutil.Equals(t, c.Result.Value, res.Value)
}
}
@ -1107,9 +1107,9 @@ func TestSubquerySelector(t *testing.T) {
res := qry.Exec(test.Context())
testutil.Equals(t, c.Result.Err, res.Err)
mat := res.parser.Value.(Matrix)
mat := res.Value.(Matrix)
sort.Sort(mat)
testutil.Equals(t, c.Result.parser.Value, mat)
testutil.Equals(t, c.Result.Value, mat)
}
}
}

View File

@ -127,7 +127,7 @@ func TestLazyLoader_WithSamplesTill(t *testing.T) {
for _, s := range tc.series {
var matchers []*labels.Matcher
for _, label := range s.Metric {
m, err := labels.NewMatcher(labels.MatchEqual, label.Name, label.parser.Value)
m, err := labels.NewMatcher(labels.MatchEqual, label.Name, label.Value)
testutil.Ok(t, err)
matchers = append(matchers, m)
}