maester icon indicating copy to clipboard operation
maester copied to clipboard

Compare to previous run

Open Arcath opened this issue 1 year ago • 4 comments

Having tests run automatically and the results being emailed over is great, however its hard to compare results, if we have X number of failures on a day then the next we have X+1 it would be great if the email report could say "you have 1 new failure {NAME}" so it is immediately flagged at the top of the message.

I know with GitHub Actions we can cache the test-results folder and keep using it (maybe need to clear old ones after a week) so that the previous run would be there to compare to.

Arcath avatar May 03 '24 10:05 Arcath

I've often thought about this as well, some thoughts I have:

  • It's hard to be a stateless framework like this is designed to be with this in place
  • it would have to support any pipeline that runs this as well as once-off runs as well
  • the framework already supports JSON file exports so arguably, another stateful mechanism could consume results and simply show runs and the difference between runs (maybe as an addition or add-on to this framework)?

jusso-dev avatar May 03 '24 10:05 jusso-dev

Might be then that Maester needs a way for us to specify a global AfterAll (Not sure if pester can do this already) and then maybe a Add-MtEmailHeader cmdlet so we can add text to the email?

Arcath avatar May 03 '24 10:05 Arcath

Yes it's a good suggestion. We need to find a way to get the previous run's results and pass it in for comparison.

merill avatar May 06 '24 21:05 merill

Example from new cmdlet in PR

image

soulemike avatar May 22 '24 03:05 soulemike

With the new release the Compare-MtTestResult cmdlet is working.

soulemike avatar Aug 05 '24 13:08 soulemike