Skip to content

Commit

Permalink
Add more test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn committed Nov 24, 2024
1 parent 1dc57f8 commit 961f2e5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/streamingpromql/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,14 @@ func TestSubqueries(t *testing.T) {
Value: promql.Matrix{},
},
},
{
// A nested subquery with the same properties as above.
Query: `last_over_time((metric > Inf)[20s:10s])[30s:5s]`,
Start: time.Unix(30, 0),
Result: promql.Result{
Value: promql.Matrix{},
},
},
{
Query: "metric[20s:5s]",
Result: promql.Result{
Expand Down
6 changes: 6 additions & 0 deletions pkg/streamingpromql/testdata/ours/subqueries.test
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,9 @@ eval range from 0 to 4m step 20s sum_over_time(sum_over_time(metric[2m:30s])[3m:

eval range from 0 to 4m step 3m sum_over_time(sum_over_time(sum_over_time(metric[2m:30s])[3m:15s])[4m:20s])
{} 0 86

eval range from 0 to 4m step 15s last_over_time((metric > Inf)[20s:10s])
# Should produce no results.

eval instant at 3m last_over_time((metric > Inf)[20s:10s])
# Should produce no results.

0 comments on commit 961f2e5

Please sign in to comment.