mkdir testrepo
cd testrepo
exec git init --initial-branch=main .

cp ../src/v1.yml rules.yml
exec ln -s xxx.yml symlink.yml
cp ../src/.pint.hcl .
env GIT_AUTHOR_NAME=pint
env GIT_AUTHOR_EMAIL=pint@example.com
env GIT_COMMITTER_NAME=pint
env GIT_COMMITTER_EMAIL=pint@example.com
exec git add .
exec git commit -am 'import rules and config'

exec git checkout -b v2
cp ../src/v2.yml rules.yml
exec git commit -am 'v2'

! exec pint -l debug -d promql/series --no-color ci
! stdout .
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:
- name: foo
  rules:
  - alert: rule1
    expr: rate(errors_total[5m]) > 0
  - alert: rule2
    expr: rate(errors_total[5m]) > 0

-- src/v2.yml --
groups:
- name: foo
  rules:
  - alert: rule1
    expr: rate(errors_total[2m]) > 0
  - alert: rule2
    expr: rate(errors_total[2m]) > 0

-- src/.pint.hcl --
ci {
  baseBranch = "main"
}

