Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test-rules plugin fails when no test files changed #6

Open
ties opened this issue Jun 5, 2023 · 0 comments
Open

test-rules plugin fails when no test files changed #6

ties opened this issue Jun 5, 2023 · 0 comments

Comments

@ties
Copy link

ties commented Jun 5, 2023

I configured test-rules by:

  - id: test-rules
    entry: --entrypoint /bin/promtool prom/prometheus:latest
    always_run: true
    files: >
      (?x)^(
        files/.*\.rules_test
      )$

But it seems that this does not pass files to promtool when no test files have changed (i.e. the changes are in the rules, not tests).

Check prometheus rule files..........................(no files to check)Skipped
Unit test prometheus rule files..........................................Failed
- hook id: test-rules
- exit code: 1

promtool: error: required argument 'test-rule-file' not provided, try --help

This may be a pre-commit limitation and/or a bug in how always_run behaves.

Expected behaviour

Tests are run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant