app/vmselect/promql: fix tests after 781947a7e2

This commit is contained in:
Aliaksandr Valialkin 2023-07-20 21:25:30 -07:00
parent 680a0d43f2
commit bd95341190
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -3007,23 +3007,21 @@ func TestExecSuccess(t *testing.T) {
t.Parallel()
q := `sort_desc(((label_set(time(), "foo", "bar", "__name__", "q1") or label_set(10, "foo", "qwert", "__name__", "q2")) / 2) keep_metric_names)`
r1 := netstorage.Result{
MetricName: storage.MetricName{
MetricGroup: []byte("q1"),
},
MetricName: metricNameExpected,
Values: []float64{500, 600, 700, 800, 900, 1000},
Timestamps: timestampsExpected,
}
r1.MetricName.MetricGroup = []byte("q1")
r1.MetricName.Tags = []storage.Tag{{
Key: []byte("foo"),
Value: []byte("bar"),
}}
r2 := netstorage.Result{
MetricName: storage.MetricName{
MetricGroup: []byte("q2"),
},
MetricName: metricNameExpected,
Values: []float64{5, 5, 5, 5, 5, 5},
Timestamps: timestampsExpected,
}
r2.MetricName.MetricGroup = []byte("q2")
r2.MetricName.Tags = []storage.Tag{{
Key: []byte("foo"),
Value: []byte("qwert"),
@ -3070,23 +3068,21 @@ func TestExecSuccess(t *testing.T) {
t.Parallel()
q := `sort_desc(2 * (label_set(time(), "foo", "bar", "__name__", "q1"), label_set(10, "foo", "qwert", "__name__", "q2")) keep_metric_names)`
r1 := netstorage.Result{
MetricName: storage.MetricName{
MetricGroup: []byte("q1"),
},
MetricName: metricNameExpected,
Values: []float64{2000, 2400, 2800, 3200, 3600, 4000},
Timestamps: timestampsExpected,
}
r1.MetricName.MetricGroup = []byte("q1")
r1.MetricName.Tags = []storage.Tag{{
Key: []byte("foo"),
Value: []byte("bar"),
}}
r2 := netstorage.Result{
MetricName: storage.MetricName{
MetricGroup: []byte("q2"),
},
MetricName: metricNameExpected,
Values: []float64{20, 20, 20, 20, 20, 20},
Timestamps: timestampsExpected,
}
r2.MetricName.MetricGroup = []byte("q2")
r2.MetricName.Tags = []storage.Tag{{
Key: []byte("foo"),
Value: []byte("qwert"),
@ -3122,23 +3118,21 @@ func TestExecSuccess(t *testing.T) {
t.Parallel()
q := `sort_desc(2 * on() group_right() (label_set(time(), "foo", "bar", "__name__", "q1"), label_set(10, "foo", "qwert", "__name__", "q2")) keep_metric_names)`
r1 := netstorage.Result{
MetricName: storage.MetricName{
MetricGroup: []byte("q1"),
},
MetricName: metricNameExpected,
Values: []float64{2000, 2400, 2800, 3200, 3600, 4000},
Timestamps: timestampsExpected,
}
r1.MetricName.MetricGroup = []byte("q1")
r1.MetricName.Tags = []storage.Tag{{
Key: []byte("foo"),
Value: []byte("bar"),
}}
r2 := netstorage.Result{
MetricName: storage.MetricName{
MetricGroup: []byte("q2"),
},
MetricName: metricNameExpected,
Values: []float64{20, 20, 20, 20, 20, 20},
Timestamps: timestampsExpected,
}
r2.MetricName.MetricGroup = []byte("q2")
r2.MetricName.Tags = []storage.Tag{{
Key: []byte("foo"),
Value: []byte("qwert"),