From 2096b73c01ea5668560e3b7e568bfac88f58e557 Mon Sep 17 00:00:00 2001 From: Kevin Tarhan Date: Tue, 29 Aug 2023 11:36:16 -0700 Subject: [PATCH] Added new test --- cmd/pint/tests/0142l_offset.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cmd/pint/tests/0142l_offset.txt diff --git a/cmd/pint/tests/0142l_offset.txt b/cmd/pint/tests/0142l_offset.txt new file mode 100644 index 00000000..c7020e12 --- /dev/null +++ b/cmd/pint/tests/0142l_offset.txt @@ -0,0 +1,28 @@ +pint.error --no-color lint rules +! stdout . +cmp stderr stderr.txt + +-- stderr.txt -- +level=info msg="Loading configuration file" path=.pint.hcl +rules/0001.yml:4 Warning: the cloud_metric offset 3m metric requires a minimum offset of 5m0s (promql/offset) + 6 | expr: cloud_metric offset 3m + +level=info msg="Problems found" Warning=1 +-- rules/0001.yml -- +- alert: ignored + expr: regular_metric +- alert: not ok + expr: cloud_metric offset 3m +- alert: ok + expr: cloud_metric offset 10m + +-- .pint.hcl -- +parser { + relaxed = [".*"] +} +rule { + offset { + prefix = "cloud_.*" + min = 5m + } +}