Skip to content

Commit c042777

Browse files
committed
Add testcase for SubQuery with offsets
1 parent 6e21538 commit c042777

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/proxystorage/proxy_test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (a *stubAPI) QueryRange(ctx context.Context, query string, r v1.Range) (mod
5050
r.Step.String(),
5151
)
5252
a.queries = append(a.queries, query+" @ "+from)
53-
return nil, nil, nil
53+
return model.Matrix{}, nil, nil
5454
}
5555

5656
// Series finds series by label matchers.
@@ -164,6 +164,13 @@ func TestNodeReplacer(t *testing.T) {
164164
"rate(http_requests_total[5m]) @ 8220 to 10000 step 1m0s",
165165
},
166166
},
167+
{
168+
in: "sum(foo{} offset 30m)[1h:5m]",
169+
out: "sum( offset 30m)[1h:5m]",
170+
queries: []string{
171+
"sum(foo) @ 4800 to 8200 step 5m0s",
172+
},
173+
},
167174

168175
// BinaryExpr
169176
// If it is a VectorSelector + scalar -- we expect it to work

0 commit comments

Comments
 (0)