Skip to content

Commit

Permalink
ci(ch-logql-compliance): add heap aggregation and offset tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Apr 28, 2024
1 parent f29231d commit 6e7ceb6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
24 changes: 24 additions & 0 deletions dev/local/ch-logql-compliance/logql-test-queries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ test_cases:
{{ .simpleRangeAggOp }}(
{job="varlogs"} [{{ .range }}]
)
# Offset.
- query: |-
{{ .simpleRangeAggOp }}(
{job="varlogs"} [{{ .range }}]
offset {{ .offset }}
)
# Absent over time range aggregation.
# NOTE(tdakkota): We do a separate test because `absent_over_time` returns non-empty result
# only if there is NO samples in step and vice versa.
Expand Down Expand Up @@ -159,6 +165,7 @@ test_cases:
) without (job)
# Vector aggregation.
#
- query: |-
{{ .simpleVecAggOp }} by (filename) (
{{ .simpleRangeAggOp }}(
Expand All @@ -173,3 +180,20 @@ test_cases:
[{{ .range }}]
)
)
# Top K/Bottom K vector aggregation.
- query: |-
{{ .topBottomVecAggOp }} by (method) (
{{ .topN }},
{{ .simpleRangeAggOp }}(
{job="varlogs"} | json method
[{{ .range }}]
)
)
# Sorting.
- query: |-
{{ .sortVecAggOp }} (
{{ .simpleRangeAggOp }}(
{job="varlogs"} | json method
[{{ .range }}]
)
)
23 changes: 12 additions & 11 deletions internal/lokicompliance/expand.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,18 @@ import (
var (
testVariantArgs = map[string][]string{
"range": {"1s", "15s", "1m", "5m", "15m", "1h"},
"offset": {"1m", "5m", "10m"},
"offset": {"1s", "5s", "15s"},
"topN": {"1", "2", "5", "10"},
"quantile": {
"0.1",
"0.5",
"0.75",
"0.95",
"0.90",
"0.99",
"1",
"1.5",
},

"simpleRangeAggOp": {
"count_over_time",
Expand Down Expand Up @@ -57,16 +68,6 @@ var (
"sortVecAggOp": {"sort", "sort_desc"},
"topBottomVecAggOp": {"topk", "bottomk"},

"quantile": {
"0.1",
"0.5",
"0.75",
"0.95",
"0.90",
"0.99",
"1",
"1.5",
},
"lineFilterOp": {"|=", "!=", "~=", "!~"},
"arithBinOp": {"+", "-", "*", "/", "%", "^"},
"logicBinOp": {"and", "or", "unless"},
Expand Down

0 comments on commit 6e7ceb6

Please sign in to comment.