JoshKeegan / xRetry

Retry running tests via Xunit and Specflow
MIT License
45 stars 14 forks source link

[enhancement request] allow logging test failure reason #242

Open dylbarne opened 1 month ago

dylbarne commented 1 month ago

In addition to the diagnostic logging that occurs in RetryTestCaseRunner, it would be nice to also be able to optionally turn on logging the particular test run failure reason/exception.

I am not too familiar with xUnit inner workings, though from their similar retry example it seems like maybe these could be pulled from ExceptionAggregator if they are considered "exceptions" or maybe these messages are already accessible elsewhere.

For my personal usecase, in the context of a build pipeline this additional logging functionality would be a valuable addition for troubleshooting why a particular test may be flaky or failing even though ultimately it is passing within the max retries.

JoshKeegan commented 1 month ago

Hopefully a user would understand why a test was flaky/could fail before enabling retries, but I'm not opposed to the additional logging. A PR adding this would be welcome.