gradle / test-retry-gradle-plugin

Gradle plugin to retry tests that have failed to mitigate test flakiness.
Apache License 2.0
220 stars 49 forks source link

Correctly handle retries of classes with nested classes #235

Closed pshevche closed 9 months ago

pshevche commented 9 months ago

Summary

The test I implemented in https://github.com/gradle/test-retry-gradle-plugin/commit/16a68b834062ff1b11431281b537746d94653cf3 was not set up correctly to assert this behavior. All nested classes were retried because the top-level class itself had a failure and matched the retry filter. If the enclosing class did not have any method failures, then we wouldn't check if it matches the class retry filter.

With this change, we check if one of the parent classes matches the class-retry filter, and if so, retry it together with all of its nested classes.