mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fix promql tests
Signed-off-by: Tobias Guggenmos <tguggenm@redhat.com>
This commit is contained in:
parent
1360f9ff12
commit
273ea9093a
|
@ -22,6 +22,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/prometheus/prometheus/pkg/labels"
|
"github.com/prometheus/prometheus/pkg/labels"
|
||||||
|
"github.com/prometheus/prometheus/promql/parser"
|
||||||
"github.com/prometheus/prometheus/util/teststorage"
|
"github.com/prometheus/prometheus/util/teststorage"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -605,7 +605,7 @@ load 10s
|
||||||
}
|
}
|
||||||
|
|
||||||
testutil.Ok(t, res.Err)
|
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())
|
res := qry.Exec(test.Context())
|
||||||
testutil.Equals(t, c.Result.Err, res.Err)
|
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())
|
res := qry.Exec(test.Context())
|
||||||
testutil.Equals(t, c.Result.Err, res.Err)
|
testutil.Equals(t, c.Result.Err, res.Err)
|
||||||
mat := res.parser.Value.(Matrix)
|
mat := res.Value.(Matrix)
|
||||||
sort.Sort(mat)
|
sort.Sort(mat)
|
||||||
testutil.Equals(t, c.Result.parser.Value, mat)
|
testutil.Equals(t, c.Result.Value, mat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ func TestLazyLoader_WithSamplesTill(t *testing.T) {
|
||||||
for _, s := range tc.series {
|
for _, s := range tc.series {
|
||||||
var matchers []*labels.Matcher
|
var matchers []*labels.Matcher
|
||||||
for _, label := range s.Metric {
|
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)
|
testutil.Ok(t, err)
|
||||||
matchers = append(matchers, m)
|
matchers = append(matchers, m)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue