@@ -38,7 +38,12 @@ import (
38
38
"github.com/cortexproject/cortex/pkg/util/log"
39
39
)
40
40
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
+ )
42
47
43
48
func init () {
44
49
for _ , f := range parser .Functions {
@@ -153,9 +158,7 @@ func TestNativeHistogramFuzz(t *testing.T) {
153
158
opts := []promqlsmith.Option {
154
159
promqlsmith .WithEnableOffset (true ),
155
160
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 ),
159
162
}
160
163
ps := promqlsmith .New (rnd , lbls , opts ... )
161
164
@@ -271,6 +274,7 @@ func TestExperimentalPromQLFuncsWithPrometheus(t *testing.T) {
271
274
promqlsmith .WithEnableOffset (true ),
272
275
promqlsmith .WithEnableAtModifier (true ),
273
276
promqlsmith .WithEnabledFunctions (enabledFunctions ),
277
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
274
278
promqlsmith .WithEnableExperimentalPromQLFunctions (true ),
275
279
}
276
280
ps := promqlsmith .New (rnd , lbls , opts ... )
@@ -376,6 +380,7 @@ func TestDisableChunkTrimmingFuzz(t *testing.T) {
376
380
promqlsmith .WithEnableOffset (true ),
377
381
promqlsmith .WithEnableAtModifier (true ),
378
382
promqlsmith .WithEnabledFunctions (enabledFunctions ),
383
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
379
384
}
380
385
ps := promqlsmith .New (rnd , lbls , opts ... )
381
386
@@ -558,6 +563,7 @@ func TestExpandedPostingsCacheFuzz(t *testing.T) {
558
563
opts := []promqlsmith.Option {
559
564
promqlsmith .WithEnableOffset (true ),
560
565
promqlsmith .WithEnableAtModifier (true ),
566
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
561
567
}
562
568
ps := promqlsmith .New (rnd , lbls , opts ... )
563
569
@@ -788,6 +794,7 @@ func TestVerticalShardingFuzz(t *testing.T) {
788
794
promqlsmith .WithEnableOffset (true ),
789
795
promqlsmith .WithEnableAtModifier (true ),
790
796
promqlsmith .WithEnabledFunctions (enabledFunctions ),
797
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
791
798
}
792
799
ps := promqlsmith .New (rnd , lbls , opts ... )
793
800
@@ -904,6 +911,7 @@ func TestProtobufCodecFuzz(t *testing.T) {
904
911
promqlsmith .WithEnableOffset (true ),
905
912
promqlsmith .WithEnableAtModifier (true ),
906
913
promqlsmith .WithEnabledFunctions (enabledFunctions ),
914
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
907
915
}
908
916
ps := promqlsmith .New (rnd , lbls , opts ... )
909
917
@@ -1600,6 +1608,7 @@ func TestBackwardCompatibilityQueryFuzz(t *testing.T) {
1600
1608
promqlsmith .WithEnableOffset (true ),
1601
1609
promqlsmith .WithEnableAtModifier (true ),
1602
1610
promqlsmith .WithEnabledFunctions (enabledFunctions ),
1611
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
1603
1612
}
1604
1613
ps := promqlsmith .New (rnd , lbls , opts ... )
1605
1614
@@ -1712,6 +1721,7 @@ func TestPrometheusCompatibilityQueryFuzz(t *testing.T) {
1712
1721
promqlsmith .WithEnableOffset (true ),
1713
1722
promqlsmith .WithEnableAtModifier (true ),
1714
1723
promqlsmith .WithEnabledFunctions (enabledFunctions ),
1724
+ promqlsmith .WithEnabledAggrs (enabledAggrs ),
1715
1725
}
1716
1726
ps := promqlsmith .New (rnd , lbls , opts ... )
1717
1727
0 commit comments