Skip to content

promtool: Add debug flag for rule tests#8349

Closed
dgl wants to merge 1 commit intoprometheus:mainfrom
dgl:promtool-debug
Closed

promtool: Add debug flag for rule tests#8349
dgl wants to merge 1 commit intoprometheus:mainfrom
dgl:promtool-debug

Conversation

@dgl
Copy link
Member

@dgl dgl commented Jan 7, 2021

This makes it print out the tsdb state (both input_series and rules that
are run) at the end of a test, making reasoning about tests much easier.

Signed-off-by: David Leadbeater dgl@dgl.cx

Base automatically changed from master to main February 23, 2021 19:36
@dgl dgl removed the request for review from simonpasquier March 17, 2021 19:43
@stale stale bot added the stale label May 17, 2021
@roidelapluie
Copy link
Member

cc @dgl are you willing to rebase this pull request? Thanks!

@dgl
Copy link
Member Author

dgl commented Sep 5, 2023

@roidelapluie I'd totally forgotten about this one, but yes, this is still useful!

This makes it print out the tsdb state (both input_series and rules that
are run) at the end of a test, making reasoning about tests much easier.

Signed-off-by: David Leadbeater <dgl@dgl.cx>
@beorn7
Copy link
Member

beorn7 commented Feb 1, 2024

@dgl we have hit this during the bug scrub again. There were test failures after your last push. Could you rebase again and make sure the tests are passing? @bwplotka will approve once that's done.

@beorn7 beorn7 requested a review from bwplotka February 1, 2024 11:36
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 for this!

LGTM, just one tiny nit and there has to be a rebase + tests passing, if you are still interested in this.

Reviewed during our bug scrub.

}

func ruleUnitTest(filename string, queryOpts promql.LazyLoaderOpts) []error {
func ruleUnitTest(debug bool, filename string, queryOpts promql.LazyLoaderOpts) []error {
Copy link
Member

Choose a reason for hiding this comment

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

hm, should we move this bool to the end, it feels like not a main parameter

Copy link
Member

Choose a reason for hiding this comment

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

resolved in #15196

@krajorama
Copy link
Member

Superseded by #15196 . Took these commits and merged main and resolved conflicts.

@krajorama krajorama closed this Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants