mirror of
https://github.com/prometheus/prometheus.git
synced 2026-07-16 12:33:18 -04:00
promtool: add promql-binop-fill-modifiers to --enable-feature handling (#19153)
Signed-off-by: vishal <httpsvishal07@gmail.com>
This commit is contained in:
parent
942dbf9adc
commit
1364c882c6
3 changed files with 5 additions and 1 deletions
|
|
@ -364,6 +364,8 @@ func main() {
|
|||
// This feature is now permanently enabled and therefore a no-op.
|
||||
case "promql-extended-range-selectors":
|
||||
promtoolParserOpts.EnableExtendedRangeSelectors = true
|
||||
case "promql-binop-fill-modifiers":
|
||||
promtoolParserOpts.EnableBinopFillModifiers = true
|
||||
case "":
|
||||
continue
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -702,7 +702,7 @@ func TestCheckRulesWithFeatureFlag(t *testing.T) {
|
|||
// As opposed to TestCheckRules calling CheckRules directly we run promtool
|
||||
// so the feature flag parsing can be tested.
|
||||
|
||||
args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "--enable-feature=promql-extended-range-selectors", "check", "rules", "testdata/features.yml"}
|
||||
args := []string{"-test.main", "--enable-feature=promql-experimental-functions", "--enable-feature=promql-extended-range-selectors", "--enable-feature=promql-binop-fill-modifiers", "check", "rules", "testdata/features.yml"}
|
||||
tool := exec.Command(promtoolPath, args...)
|
||||
err := tool.Run()
|
||||
require.NoError(t, err)
|
||||
|
|
|
|||
2
cmd/promtool/testdata/features.yml
vendored
2
cmd/promtool/testdata/features.yml
vendored
|
|
@ -8,3 +8,5 @@ groups:
|
|||
expr: rate(up[1m * 2])
|
||||
- record: promql-extended-range-selectors
|
||||
expr: rate(up[1m] anchored)
|
||||
- record: promql-binop-fill-modifiers
|
||||
expr: rate(up[5m]) + fill(0) rate(down[5m])
|
||||
|
|
|
|||
Loading…
Reference in a new issue