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

Retry Spock2 parameterized methods independently of the class #202

Closed pshevche closed 1 year ago

pshevche commented 1 year ago

Summary

Previously, if Spock tests were executed using Gradle's JUnitPlatformTestFramework, we would retry an entire class if one of its parameterized methods failed. This applied both to Spock 2 tests and Spock 1 tests run with JUnit Vintage engine. However, parameterized tests cannot be retried independently only in the latter case.

This PR changes that and checks for spock-core-2* JAR on the classpath to differentiate between both cases. If the JAR is present, parameterized tests will be retried independently, otherwise, as an entire class.