feat(tools): add debug printouts to rules unit testing (#15196)
* promtool: Add debug flag for rule tests
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>
* Reuse generated test name from junit testing
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
---------
Signed-off-by: David Leadbeater <dgl@dgl.cx>
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
Co-authored-by: David Leadbeater <dgl@dgl.cx>
testRulesDebug:=testRulesCmd.Flag("debug","Enable unit test debugging.").Default("false").Bool()
testRulesDiff:=testRulesCmd.Flag("diff","[Experimental] Print colored differential output between expected & received output.").Default("false").Bool()
| <codeclass="text-nowrap">--run</code><codeclass="text-nowrap">...<codeclass="text-nowrap"> | If set, will only run test groups whose names match the regular expression. Can be specified multiple times. | |
| <codeclass="text-nowrap">--debug</code> | Enable unit test debugging. | `false` |
| <codeclass="text-nowrap">--diff</code> | [Experimental] Print colored differential output between expected & received output. | `false` |