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

Add '--run' flag to promtool test rules #12206

Conversation

machadovilaca
Copy link
Contributor

@machadovilaca machadovilaca commented Mar 31, 2023

When developing unit tests for rules it would be helpful to be able to run only a single group and avoid testing all test groups in a single file.
This PR adds a new --run flag to promtool test rules that allows users to pass multiple regular expressions to filter the test groups that will be run based on their names.

@machadovilaca machadovilaca requested a review from dgl as a code owner March 31, 2023 23:47
@machadovilaca machadovilaca force-pushed the add-focus-flag-to-promtool-test-rules branch from a1e2a74 to f163fda Compare March 31, 2023 23:57
@machadovilaca
Copy link
Contributor Author

@dgl are you able to take a look at this?

@roidelapluie
Copy link
Member

Can we find a more intuitive name for the flag?

@roidelapluie
Copy link
Member

maybe --run, like go test?

@roidelapluie
Copy link
Member

Hi @machadovilaca , we looked at this during our bug scrub, would you like to continue working on this pull request and update the flag name to --run? Thanks!

@machadovilaca
Copy link
Contributor Author

@roidelapluie Hi, I've been a little short on time, thanks for the reminder and I'll make sure I take 10min to update the PR this week.

Signed-off-by: João Vilaça <jvilaca@redhat.com>
@machadovilaca machadovilaca force-pushed the add-focus-flag-to-promtool-test-rules branch from f163fda to 81394ea Compare June 28, 2023 16:58
@machadovilaca machadovilaca changed the title Add 'focus' flag to promtool test rules Add '--run' flag to promtool test rules Jun 28, 2023
@machadovilaca
Copy link
Contributor Author

@roidelapluie updated

@machadovilaca
Copy link
Contributor Author

@roidelapluie ping

Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM 💪🏽

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
@roidelapluie roidelapluie merged commit cef8aca into prometheus:main Dec 5, 2023
24 checks passed
@roidelapluie
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

3 participants