exec bash -x ./test.sh &

pint.ok watch --listen=:6049 --min-severity=warning --pidfile=pint.pid rules
cmp curl.txt metrics.txt

-- test.sh --
sleep 5
curl -s http://127.0.0.1:6049/metrics | grep -E '^pint_problem' > curl.txt
cat pint.pid | xargs kill

-- rules/1.yml --
- record: broken
  expr: foo / count())

- record: aggregate
  expr: sum(foo) without(job)

- alert: comparison
  expr: foo

-- .pint.hcl --
rule {
    match {
      kind = "recording"
    }
    aggregate ".+" {
        keep = [ "job" ]
    }
}

-- metrics.txt --
pint_problem{filename="rules/1.yml",kind="alerting",name="comparison",problem="alert query doesn't have any condition, it will always fire if the metric exists",reporter="alerts/comparison",severity="warning"} 1
pint_problem{filename="rules/1.yml",kind="recording",name="aggregate",problem="job label is required and should be preserved when aggregating \"^.+$\" rules, remove job from without()",reporter="promql/aggregate",severity="warning"} 1
pint_problem{filename="rules/1.yml",kind="recording",name="broken",problem="syntax error: no arguments for aggregate expression provided",reporter="promql/syntax",severity="fatal"} 1
pint_problems 3
