Skip to content

Commit a73deb4

Browse files
authored
Disable topk and bottomk aggregation in query fuzz test (#6802)
* disable topk and bottomk aggregation in query fuzz test Signed-off-by: yeya24 <[email protected]> * lint Signed-off-by: yeya24 <[email protected]> --------- Signed-off-by: yeya24 <[email protected]>
1 parent cd7d881 commit a73deb4

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

integration/query_fuzz_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ import (
3838
"github.com/cortexproject/cortex/pkg/util/log"
3939
)
4040

41-
var enabledFunctions []*parser.Function
41+
var (
42+
enabledFunctions []*parser.Function
43+
enabledAggrs = []parser.ItemType{
44+
parser.SUM, parser.MIN, parser.MAX, parser.AVG, parser.GROUP, parser.COUNT, parser.COUNT_VALUES, parser.QUANTILE,
45+
}
46+
)
4247

4348
func init() {
4449
for _, f := range parser.Functions {
@@ -153,9 +158,7 @@ func TestNativeHistogramFuzz(t *testing.T) {
153158
opts := []promqlsmith.Option{
154159
promqlsmith.WithEnableOffset(true),
155160
promqlsmith.WithEnableAtModifier(true),
156-
promqlsmith.WithEnabledAggrs([]parser.ItemType{
157-
parser.SUM, parser.MIN, parser.MAX, parser.AVG, parser.GROUP, parser.COUNT, parser.COUNT_VALUES, parser.QUANTILE,
158-
}),
161+
promqlsmith.WithEnabledAggrs(enabledAggrs),
159162
}
160163
ps := promqlsmith.New(rnd, lbls, opts...)
161164

@@ -271,6 +274,7 @@ func TestExperimentalPromQLFuncsWithPrometheus(t *testing.T) {
271274
promqlsmith.WithEnableOffset(true),
272275
promqlsmith.WithEnableAtModifier(true),
273276
promqlsmith.WithEnabledFunctions(enabledFunctions),
277+
promqlsmith.WithEnabledAggrs(enabledAggrs),
274278
promqlsmith.WithEnableExperimentalPromQLFunctions(true),
275279
}
276280
ps := promqlsmith.New(rnd, lbls, opts...)
@@ -376,6 +380,7 @@ func TestDisableChunkTrimmingFuzz(t *testing.T) {
376380
promqlsmith.WithEnableOffset(true),
377381
promqlsmith.WithEnableAtModifier(true),
378382
promqlsmith.WithEnabledFunctions(enabledFunctions),
383+
promqlsmith.WithEnabledAggrs(enabledAggrs),
379384
}
380385
ps := promqlsmith.New(rnd, lbls, opts...)
381386

@@ -558,6 +563,7 @@ func TestExpandedPostingsCacheFuzz(t *testing.T) {
558563
opts := []promqlsmith.Option{
559564
promqlsmith.WithEnableOffset(true),
560565
promqlsmith.WithEnableAtModifier(true),
566+
promqlsmith.WithEnabledAggrs(enabledAggrs),
561567
}
562568
ps := promqlsmith.New(rnd, lbls, opts...)
563569

@@ -788,6 +794,7 @@ func TestVerticalShardingFuzz(t *testing.T) {
788794
promqlsmith.WithEnableOffset(true),
789795
promqlsmith.WithEnableAtModifier(true),
790796
promqlsmith.WithEnabledFunctions(enabledFunctions),
797+
promqlsmith.WithEnabledAggrs(enabledAggrs),
791798
}
792799
ps := promqlsmith.New(rnd, lbls, opts...)
793800

@@ -904,6 +911,7 @@ func TestProtobufCodecFuzz(t *testing.T) {
904911
promqlsmith.WithEnableOffset(true),
905912
promqlsmith.WithEnableAtModifier(true),
906913
promqlsmith.WithEnabledFunctions(enabledFunctions),
914+
promqlsmith.WithEnabledAggrs(enabledAggrs),
907915
}
908916
ps := promqlsmith.New(rnd, lbls, opts...)
909917

@@ -1600,6 +1608,7 @@ func TestBackwardCompatibilityQueryFuzz(t *testing.T) {
16001608
promqlsmith.WithEnableOffset(true),
16011609
promqlsmith.WithEnableAtModifier(true),
16021610
promqlsmith.WithEnabledFunctions(enabledFunctions),
1611+
promqlsmith.WithEnabledAggrs(enabledAggrs),
16031612
}
16041613
ps := promqlsmith.New(rnd, lbls, opts...)
16051614

@@ -1712,6 +1721,7 @@ func TestPrometheusCompatibilityQueryFuzz(t *testing.T) {
17121721
promqlsmith.WithEnableOffset(true),
17131722
promqlsmith.WithEnableAtModifier(true),
17141723
promqlsmith.WithEnabledFunctions(enabledFunctions),
1724+
promqlsmith.WithEnabledAggrs(enabledAggrs),
17151725
}
17161726
ps := promqlsmith.New(rnd, lbls, opts...)
17171727

0 commit comments

Comments
 (0)