Skip to content

Commit

Permalink
Update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
prymitive committed Feb 25, 2025
1 parent ed597d5 commit 4994fed
Show file tree
Hide file tree
Showing 99 changed files with 102 additions and 111 deletions.
15 changes: 3 additions & 12 deletions cmd/pint/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"encoding/pem"
"errors"
"fmt"
"log/slog"
"math/big"
"net"
"net/http"
Expand All @@ -26,17 +25,9 @@ import (
)

func TestMain(m *testing.M) {
os.Exit(testscript.RunMain(m, map[string]func() int{
"pint": func() int {
app := newApp()
err := app.Run(os.Args)
if err != nil {
slog.Error("Fatal error", slog.Any("err", err))
return 1
}
return 0
},
}))
testscript.Main(m, map[string]func(){
"pint": main,
})
}

func TestScripts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0001_match_path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rules/0002.yml:2 Bug: `job` label is required and should be preserved when aggre
2 | expr: sum(foo) without(job)

level=INFO msg="Problems found" Bug=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- record: "colo:test1"
expr: sum(foo) without(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0002_nothing_to_lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Finding all rules to check" paths=["rules"]
level=ERROR msg="Fatal error" err="no matching files"
level=ERROR msg="Execution completed with error(s)" err="no matching files"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0003_lint_workdir.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ rules/0003.yaml:61 Information: Using the value of `rate(errors[5m])` inside thi
61 | summary: 'error rate: {{ $value }}'

level=INFO msg="Problems found" Fatal=1 Bug=2 Warning=10 Information=1
level=ERROR msg="Fatal error" err="found 2 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 2 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- record: colo_job:fl_cf_html_bytes_in:rate10m
expr: sum(rate(fl_cf_html_bytes_in[10m])) WITHOUT (colo_id, instance, node_type, region, node_status, job, colo_name)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0004_fail_invalid_yaml.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ rules/ok.yml:5 Fatal: Prometheus failed to parse the query with this PromQL erro
5 | expr: sum(foo[5m)

level=INFO msg="Problems found" Fatal=2
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/ok.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0006_rr_labels.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rules/0001.yml:8 Fatal: This rule is not a valid Prometheus rule: `incomplete ru
8 | - expr: sum(foo)

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0007_alerts.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rules/0002.yml:12 Bug: Using `.Value` in labels will generate a new alert on eve
12 | val: '{{ .Value|humanizeDuration }}'

level=INFO msg="Problems found" Fatal=4 Bug=5 Warning=4
level=ERROR msg="Fatal error" err="found 2 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 2 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- alert: Always
expr: up
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0008_recording_rule_prometheus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ rules/0001.yml:5 Bug: `instance` label should be removed when aggregating `^colo
5 | expr: sum by (instance) (http_inprogress_requests)

level=INFO msg="Problems found" Bug=1 Warning=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
groups:
- name: example
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0009_alerting_rule_prometheus.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rules/0001.yml:19-21 Bug: `link` annotation is required. (alerts/annotation)
21 | description: "{{ $labels.instance }} has a median request latency above 1s (current value: {{ $value }}s)"

level=INFO msg="Problems found" Bug=2 Warning=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
groups:
- name: example
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0010_syntax_check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rules/1.yaml:6 Fatal: did not find expected '-' indicator (yaml/parse)
6 |

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/1.yaml --
- alert: Good
expr: up == 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0011_ignore_rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rules/1.yaml:33 Warning: `job` label is required and should be preserved when ag
33 | expr: sum(errors_total) without(job)

level=INFO msg="Problems found" Fatal=2 Warning=3
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/1.yaml --
- record: disabled
expr: sum(errors_total) by ) # pint disable promql/syntax
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0013_issue49_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=not_existed_config.hcl
level=ERROR msg="Fatal error" err="failed to load config file \"not_existed_config.hcl\": <nil>: Configuration file not found; The configuration file not_existed_config.hcl does not exist."
level=ERROR msg="Execution completed with error(s)" err="failed to load config file \"not_existed_config.hcl\": <nil>: Configuration file not found; The configuration file not_existed_config.hcl does not exist."
2 changes: 1 addition & 1 deletion cmd/pint/tests/0017_issue69.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4230,7 +4230,7 @@ rules/template.yml:4-5 Bug: `severity` label is required. (rule/label)
4 | - alert: Test Alert 2
5 | expr: up == 0

level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- copy.sh --
for I in `seq 1 263` ; do cp rules/template.yml rules/$I.yml ; done

Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0021_ignore_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=ERROR msg="Fatal error" err="failed to load config file \".pint.hcl\": ignore block must have at least one condition"
level=ERROR msg="Execution completed with error(s)" err="failed to load config file \".pint.hcl\": ignore block must have at least one condition"
-- rules/0001.yml --
- record: "colo:recording"
expr: sum(foo) without(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0024_color_output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ cmp stderr stderr.txt
 40 | expr: sum(byinstance) by(instance)

level=INFO msg="Problems found" Fatal=1 Warning=10
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- record: colo_job:fl_cf_html_bytes_in:rate10m
expr: sum(rate(fl_cf_html_bytes_in[10m])) WITHOUT (colo_id, instance, node_type, region, node_status, job, colo_name)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0026_aggregate_empty_name.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=ERROR msg="Fatal error" err="failed to load config file \".pint.hcl\": empty name regex"
level=ERROR msg="Execution completed with error(s)" err="failed to load config file \".pint.hcl\": empty name regex"
-- .pint.hcl --
rule {
match {
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0027_ci_branch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level=INFO msg="Problems found" Fatal=1
rules.yml:2 Fatal: Prometheus failed to parse the query with this PromQL error: unexpected identifier "bi". (promql/syntax)
2 | expr: sum(foo) bi(job)

level=ERROR msg="Fatal error" err="problems found"
level=ERROR msg="Execution completed with error(s)" err="problems found"
-- src/v1.yml --
- record: rule1
expr: sum(foo) by(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0028_ci_git_error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ level=DEBUG msg="File path is in the exclude list" path=.pint.hcl exclude=["^.pi
level=DEBUG msg="File parsed" path=rules.yml rules=2
level=DEBUG msg="Glob finder completed" count=2
level=DEBUG msg="Running git command" args=["log","--reverse","--no-merges","--first-parent","--format=%H","--name-status","notmain..HEAD"]
level=ERROR msg="Fatal error" err="failed to get the list of modified files from git: fatal: ambiguous argument 'notmain..HEAD': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'\n"
level=ERROR msg="Execution completed with error(s)" err="failed to get the list of modified files from git: fatal: ambiguous argument 'notmain..HEAD': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'\n"
-- src/v1.yml --
- record: rule1
expr: sum(foo) by(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0029_ci_too_many_commits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cmp stderr ../stderr.txt
-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=INFO msg="Finding all rules to check on current git branch" base=main
level=ERROR msg="Fatal error" err="number of commits to check (3) is higher than maxCommits (2), exiting"
level=ERROR msg="Execution completed with error(s)" err="number of commits to check (3) is higher than maxCommits (2), exiting"
-- src/v1.yml --
- record: rule1
expr: sum(foo) by(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0035_bad_loglevel.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
! exec pint -l invalid --no-color lint rules
! stdout .
stderr 'ERROR Fatal error err="failed to set log level: ''invalid'' is not a valid log level"'
stderr 'ERROR Execution completed with error\(s\) err="failed to set log level: ''invalid'' is not a valid log level"'
2 changes: 1 addition & 1 deletion cmd/pint/tests/0044_parse_error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
cmp stderr stderr.txt

-- stderr.txt --
level=ERROR msg="Fatal error" err="1:13: parse error: unclosed left parenthesis"
level=ERROR msg="Execution completed with error(s)" err="1:13: parse error: unclosed left parenthesis"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0045_parse_no_query.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
cmp stderr stderr.txt

-- stderr.txt --
level=ERROR msg="Fatal error" err="a query string is required"
level=ERROR msg="Execution completed with error(s)" err="a query string is required"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0051_watch_severity_invalid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
cmp stderr stderr.txt

-- stderr.txt --
level=ERROR msg="Fatal error" err="invalid --min-severity value: unknown severity: foo"
level=ERROR msg="Execution completed with error(s)" err="invalid --min-severity value: unknown severity: foo"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0058_templated_check.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ rules/0001.yml:12 Bug: `alert_for` annotation value `4m` must match `^{{ $for }}
12 | alert_for: 4m

level=INFO msg="Problems found" Bug=2
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/0001.yml --
- alert: Instance Is Down 1
expr: up == 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0059_templated_check_bad_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=ERROR msg="Fatal error" err="failed to load config file \".pint.hcl\": template: regexp:1:126: executing \"regexp\" at <nil>: nil is not a command"
level=ERROR msg="Execution completed with error(s)" err="failed to load config file \".pint.hcl\": template: regexp:1:126: executing \"regexp\" at <nil>: nil is not a command"
-- rules/0001.yml --
- alert: Instance Is Down 1
expr: up == 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0060_ci_noop.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ level=INFO msg="Problems found" Fatal=1
b.yml:2 Fatal: Prometheus failed to parse the query with this PromQL error: unexpected identifier "bi". (promql/syntax)
2 | expr: sum(foo) bi()

level=ERROR msg="Fatal error" err="problems found"
level=ERROR msg="Execution completed with error(s)" err="problems found"
-- src/a.yml --
- record: rule1
expr: sum(foo) bi()
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0061_lint_workers_zero.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
cmp stderr stderr.txt

-- stderr.txt --
level=ERROR msg="Fatal error" err="--workers flag must be > 0"
level=ERROR msg="Execution completed with error(s)" err="--workers flag must be > 0"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0062_lint_no_args.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
cmp stderr stderr.txt

-- stderr.txt --
level=ERROR msg="Fatal error" err="at least one file or directory required"
level=ERROR msg="Execution completed with error(s)" err="at least one file or directory required"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0064_watch_no_path.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
cmp stderr stderr.txt

-- stderr.txt --
level=ERROR msg="Fatal error" err="at least one file or directory required"
level=ERROR msg="Execution completed with error(s)" err="at least one file or directory required"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0066_lint_owner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rules/3.yml:1-2 Bug: `rule/owner` comments are required in all files, please add
2 | expr: up{job="foo"} == 0

level=INFO msg="Problems found" Bug=3
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/1.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0067_relaxed.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ rules/strict.yml:2 Fatal: top level field must be a groups key, got list (yaml/p
2 | - alert: No Owner

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/strict.yml --
{%- raw %} # pint ignore/line
- alert: No Owner
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0069_bitbucket_unmodified.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ rules.yml:5 Bug: Unnecessary regexp match on static string `job=~"xxx"`, use `jo
rules.yml:6 Information: `0s` is the default value of `for`, consider removing this redundant line. (alerts/for)
6 | for: 0s

level=ERROR msg="Fatal error" err="problems found"
level=ERROR msg="Execution completed with error(s)" err="problems found"
-- src/v1.yml --
- alert: rule1a
expr: sum(foo{job=~"xxx"}) by(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0071_ci_owner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ rules.yml:6-7 Bug: `rule/owner` comments are required in all files, please add a
6 | - alert: rule2
7 | expr: sum(foo) by(job) > 0

level=ERROR msg="Fatal error" err="problems found"
level=ERROR msg="Execution completed with error(s)" err="problems found"
-- src/v1.yml --
- alert: rule1
expr: sum(foo) by(job)
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0073_lint_k8s.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ rules/1.yml:28 Fatal: This rule is not a valid Prometheus rule: `duplicated expr
28 | expr: sum(rate(kube_pod_container_status_restarts_total{namespace="example-app"}[5m])) > ( 3/60 )

level=INFO msg="Problems found" Fatal=2 Bug=4
level=ERROR msg="Fatal error" err="found 2 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 2 problem(s) with severity Bug or higher"
-- rules/1.yml --
---
kind: ConfigMap
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0074_strict_error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rules/strict.yml:2 Fatal: invalid group key alert (yaml/parse)
2 | - alert: Conntrack_Table_Almost_Full

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/strict.yml --
groups:
- alert: Conntrack_Table_Almost_Full
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0076_ci_group_errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,4 @@ rules.yml:38-39 Bug: `rule/owner` comments are required in all files, please add
rules.yml:39 Warning: Alert query doesn't have any condition, it will always fire if the metric exists. (alerts/comparison)
39 | expr: errors / sum(requests) without(rack)

level=ERROR msg="Fatal error" err="submitting reports: fatal error(s) reported"
level=ERROR msg="Execution completed with error(s)" err="submitting reports: fatal error(s) reported"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0077_strict_error_owner.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rules/strict.yml:4-7 Bug: `rule/owner` comments are required in all files, pleas
7 | foo: bar

level=INFO msg="Problems found" Bug=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/strict.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0078_repeated_group.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rules/strict.yml:4 Fatal: duplicated group name (yaml/parse)
4 | - name: foo

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/strict.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0079_check_promql_series_invalid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Loading configuration file" path=.pint.hcl
level=ERROR msg="Fatal error" err="failed to load config file \".pint.hcl\": .pint.hcl:7,3-6: Unsupported argument; An argument named \"bob\" is not expected here."
level=ERROR msg="Execution completed with error(s)" err="failed to load config file \".pint.hcl\": .pint.hcl:7,3-6: Unsupported argument; An argument named \"bob\" is not expected here."
-- .pint.hcl --
prometheus "prom" {
uri = "http://127.0.0.1"
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0081_rulefmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ rules/strict.yml:4 Fatal: This rule is not a valid Prometheus rule: `missing exp
4 | - record: foo

level=INFO msg="Problems found" Fatal=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/strict.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0086_rulefmt_ignored_errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ rules/strict.yml:20 Fatal: Template failed to parse with this error: `function "
20 | dashboard: '{{ bogus }}'

level=INFO msg="Problems found" Fatal=5
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/strict.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0087_dedup.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rules/01.yml:13 Bug: Template is using `cluster` label but the query results won
13 | dashboard: "https://grafana.example.com/dashboard?var-cluster={{ $labels.cluster }}&var-instance={{ $labels.cluster }}"

level=INFO msg="Problems found" Bug=3 Warning=1
level=ERROR msg="Fatal error" err="found 1 problem(s) with severity Bug or higher"
level=ERROR msg="Execution completed with error(s)" err="found 1 problem(s) with severity Bug or higher"
-- rules/01.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0091_lint_min_severity_invalid.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmp stderr stderr.txt
-- stderr.txt --
level=INFO msg="Finding all rules to check" paths=["rules"]
level=INFO msg="Checking Prometheus rules" entries=1 workers=10 online=true
level=ERROR msg="Fatal error" err="invalid --min-severity value: unknown severity: xxx"
level=ERROR msg="Execution completed with error(s)" err="invalid --min-severity value: unknown severity: xxx"
-- rules/0001.yml --
groups:
- name: foo
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0096_bad_symlink.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ cmp stderr stderr.txt

-- stderr.txt --
level=INFO msg="Finding all rules to check" paths=["rules"]
level=ERROR msg="Fatal error" err="rules/symlink.yml is a symlink but target file cannot be evaluated: lstat rules/../bad.yml: no such file or directory"
level=ERROR msg="Execution completed with error(s)" err="rules/symlink.yml is a symlink but target file cannot be evaluated: lstat rules/../bad.yml: no such file or directory"
2 changes: 1 addition & 1 deletion cmd/pint/tests/0097_rule_file_symlink_error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exec git commit -am 'v2'

! exec pint -l debug -d promql/series --no-color ci
! stdout .
stderr 'level=ERROR msg="Fatal error" err="symlink.yml is a symlink but target file cannot be evaluated: lstat xxx.yml: no such file or directory"'
stderr 'level=ERROR msg="Execution completed with error\(s\)" err="symlink.yml is a symlink but target file cannot be evaluated: lstat xxx.yml: no such file or directory"'

-- src/v1.yml --
groups:
Expand Down
2 changes: 1 addition & 1 deletion cmd/pint/tests/0106_ci_git_branch_error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ cmp stderr stderr.txt

-- stderr.txt --
level=DEBUG msg="Running git command" args=["rev-parse","--abbrev-ref","HEAD"]
level=ERROR msg="Fatal error" err="failed to get the name of current branch"
level=ERROR msg="Execution completed with error(s)" err="failed to get the name of current branch"
Loading

0 comments on commit 4994fed

Please sign in to comment.