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

Retry Plugin Retries All Cucumber Tests Instead of Only Failed Tests #149

Closed
lnhrdt opened this issue Dec 22, 2024 · 2 comments
Closed

Retry Plugin Retries All Cucumber Tests Instead of Only Failed Tests #149

lnhrdt opened this issue Dec 22, 2024 · 2 comments

Comments

@lnhrdt
Copy link

lnhrdt commented Dec 22, 2024

The Cucumber Companion plugin docs describe how to use it with the Test Retry plugin, so I tried using them together. But I've found an issue where retries don’t work as expected in projects with both plugins.

Reproduction

I created a repo to demostrate the issue: https://github.com/lnhrdt/gradle-plugin-cucumber-retry-issue

The repo has three subprojects:

  1. just-junit
  2. suite
  3. cucumber

Each subproject contains two tests (one passing, one failing) and configures the Test Retry plugin to retry failed tests once.

Run this command to reproduce the issue:

./gradlew test --continue

Expected Behavior:

  • Passing tests run once in each subproject.
  • Failing tests run twice in each subproject.

Observed Behavior:

  • just-junit and suite: Passing tests run once and failing tests retry correctly.
  • cucumber: Passing tests incorrectly run twice.

Sample Output:

> Task :cucumber:test FAILED

fail > Cucumber > Fail > features.fail.it fails FAILED
    org.opentest4j.AssertionFailedError at JUnitSupport.kt:56

pass > Cucumber > Pass > features.pass.it passes PASSED

fail > Cucumber > Fail > features.fail.it fails FAILED
    org.opentest4j.AssertionFailedError at JUnitSupport.kt:56

pass > Cucumber > Pass > features.pass.it passes PASSED

4 tests completed, 2 failed

> Task :just-junit:test FAILED

FailTest > alwaysFail() FAILED
    org.opentest4j.AssertionFailedError at FailTest.kt:9

PassTest > alwaysPass() PASSED

FailTest > alwaysFail() FAILED
    org.opentest4j.AssertionFailedError at FailTest.kt:9

3 tests completed, 2 failed

> Task :suite:test FAILED

FailTest > alwaysFail() FAILED
    org.opentest4j.AssertionFailedError at FailTest.kt:9

PassTest > alwaysPass() PASSED

FailTest > alwaysFail() FAILED
    org.opentest4j.AssertionFailedError at FailTest.kt:9

3 tests completed, 2 failed

Notes

I suspect this issue is related to the Cucumber Companion plugin but acknowledge it could stem from my project setup or the Test Retry plugin. Let me know if I should report this issue to the Test Retry plugin instead.

@pshevche
Copy link
Member

@lnhrdt , thank you for reaching out. This is a limitation of the retry plugin: gradle/test-retry-gradle-plugin#276 (comment). As I mention in that issue, having proper retry support for Cucumber features is on our roadmap, but we don't have a timeline yet.

@lnhrdt
Copy link
Author

lnhrdt commented Jan 2, 2025

Thanks @pshevche for the context here that test-retry is the culprit.

After looking through the comments, it seems that gradle/test-retry-gradle-plugin#278 is the issue my team should follow–our projects (and the reproduction project I shared) use JUnit 5, not 4.

I understand you don't have a timeline to share but we'll stay subscribed to those issues for update. We'd get a lot of value out of having this limitation resolved!

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

No branches or pull requests

2 participants