Skip to content

Commit

Permalink
Add testcase for SubQuery with offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksontj committed Sep 14, 2024
1 parent a6ac4ee commit 3844a24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/proxystorage/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (a *stubAPI) QueryRange(ctx context.Context, query string, r v1.Range) (mod
r.Step.String(),
)
a.queries = append(a.queries, query+" @ "+from)
return nil, nil, nil
return model.Matrix{}, nil, nil
}

// Series finds series by label matchers.
Expand Down Expand Up @@ -164,6 +164,13 @@ func TestNodeReplacer(t *testing.T) {
"rate(http_requests_total[5m]) @ 8220 to 10000 step 1m0s",
},
},
{
in: "sum(foo{} offset 30m)[1h:5m]",
out: "sum(foo)[1h:5m]",
queries: []string{
"sum(foo) @ 4800 to 8200 step 5m0s",
},
},

// BinaryExpr
// If it is a VectorSelector + scalar -- we expect it to work
Expand Down

0 comments on commit 3844a24

Please sign in to comment.