Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix class-level retry with Gradle 5.0 and Suite engine or @Nested test classes #231

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

snoopcheri
Copy link
Member

This PR adds special handling when Gradle 5.0 is used.

At the end of each round, entries for test classes w/o test methods from previousRoundFailedTests, when using Gradle 5.0. For Gradle 5.1 and above this would automatically happen, as Gradle also reports events for intermediate classes, when JUnit's suite engine is used or when test classes are @nested.

To be on the safe side, we're only removing entries for test classes, if we observed this test class during the current round. It's not a perfect solution but allows using the class-retry feature of the Test Retry Gradle plugin together with test suites and nested class for Gradle 5.0 as well.

Fixes #230

Signed-off-by: Daniel Clausen <dclausen@gradle.com>
When using Gradle 5.0 in combination with JUnit's suite runner
or when using @nested test classes, we lack test events for the
intermediate classes.

This leads to a problem when an intermediate class is configured
for class-level retry.

In order to fix this, we manually remove specific entries from
the failed tests at the end of a round. But we only do this
for Gradle 5.0, as test reporting for newer version does not
exhibit this problem.

Signed-off-by: Daniel Clausen <dclausen@gradle.com>
…sses

Verification for Gradle 5.0 adjusted.

Signed-off-by: Daniel Clausen <dclausen@gradle.com>
@snoopcheri snoopcheri requested review from pshevche and a team November 1, 2023 12:58
@snoopcheri snoopcheri self-assigned this Nov 1, 2023
Signed-off-by: Daniel Clausen <dclausen@gradle.com>
@snoopcheri snoopcheri requested a review from pshevche November 2, 2023 08:53
@snoopcheri snoopcheri merged commit 2354682 into main Nov 3, 2023
5 checks passed
@snoopcheri snoopcheri deleted the snoopcheri/fix-class-level-retry-with-gradle-5 branch November 3, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test retry on class level fails with suite engine and Gradle 5.0
2 participants