JoshKeegan / xRetry

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

Feature: Global configuration #77

Open JoshKeegan opened 3 years ago

JoshKeegan commented 3 years ago

Add a global configuration that would allow for defaults to be set for an entire test project. This would be at the xRetry level (so would apply to specflow and xunit tests) and cover:

Idea came from #71, but is implemeted there in a specflow-only manner.

mtaghavi2005 commented 1 year ago

We already need to have this feature in our test project because there are many feature files (over 300 scenarios) and somehow tests are randomly failing. So, it would be great if we can set it globally for all scenarios. If it is ok for you, I will create PR for this feature.

dylbarne commented 1 month ago

@JoshKeegan in addition to the global configuration options you outlined, I think it would also be nice to provide some global condition to dynamically configure whether or not the test running executes a retry at all.

Usecase: be able to keep existing code flagged with [RetryFact] etc., but then conditionally disable the retry functionality temporarily during local development at a global level without making individual test method attribute changes. Most often during initial development or later troubleshooting of flaky tests the retry logic just gets in the way since the test is likely failing the first time already. Ideally would just disable retry functionality in a development/debugging context globally and the retries would only occur in a build pipeline context where this is more applicable.