Skip to content

Surefire 3.5.3 does not include Cucumber scenarios in test summary count #2984

Closed

Description

@fslevoaca-ionos

👓 What did you see?

It seems Maven Surefire reports are no longer generated correctly after upgrading to Maven Surefire 3.5.3.
It always indicates 0 test run.

-------------------------------------------------------------------------------
Test set: io.example.CalculatorTest
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.17 s -- in io.example.CalculatorTest

✅ What did you expect to see?

Tests should be again properly logged inside Maven surefire report

📦 Which tool/library version are you using?

cucumber-java 7.21.1
maven surefire 3.5.3
junit.bom.version 5.12.1

🔬 How could we reproduce it?

This issue is reproducing only using Cucumber JVM, Maven Surefire 3.5.3 and Junit 5.
I've made some separate tests using only Maven Surefire 3.5.3 and Junit 5 and it works fine.
The problem reproduces only when Cucumber is added into the mix.

Steps:
1.) Git clone the following showcase project
https://github.com/fslev/cucumber-showcase

2.) Run Maven command
mvn clean test

Actual:
Though the scenarios were successfully executed, there is no related information inside target/surefire-reports/io.example.CalculatorTest.txt

-------------------------------------------------------------------------------
Test set: io.example.CalculatorTest
-------------------------------------------------------------------------------
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 12.17 s -- in io.example.CalculatorTest

3.) Downgrade Maven Surefire to 3.5.2
Actual:
Everything works fine now.

📚 Any additional context?

Inside Maven Surefire release notes there are some interesting fixes which may have impacted the way Cucumber works:
https://github.com/apache/maven-surefire/releases/tag/maven-surefire-3.5.3

Activity

  1. changed the title [-]Missing information about executed scenarios inside surefire reports[/-] [+]Missing information about executed scenarios inside Surefire reports[/+] on Mar 31, 2025
  2. pzygielo commented on Mar 31, 2025

    @pzygielo
    Contributor
  3. mpkorstanje commented on Mar 31, 2025

    @mpkorstanje
    Member

    Hey thanks for the heads up!

    As this works in 3.5.2 and fails in 3.5.3 this is probably a problem with Surefire. But I currently don't have the time for a deep dive. I think you'll want to report it to Surefire. Using the https://github.com/cucumber/cucumber-java-skeleton/ should make a good base for a reproducer.

  4. fslevoaca-ionos commented on Mar 31, 2025

    @fslevoaca-ionos
    Author

    Ok,
    I will close this issue for now.
    Opened similar issue on their side:
    https://issues.apache.org/jira/browse/SUREFIRE-2299

    Thanks,

  5. mpkorstanje commented on Apr 11, 2025

    @mpkorstanje
    Member

    Fix being worked on here apache/maven-surefire#828

  6. changed the title [-]Missing information about executed scenarios inside Surefire reports[/-] [+]Surefire 2.5.3 does include Cucumber tests in test summary count[/+] on Jun 11, 2025
  7. changed the title [-]Surefire 2.5.3 does include Cucumber tests in test summary count[/-] [+]Surefire 2.5.3 does include Cucumber scenarios in test summary count[/+] on Jun 11, 2025
  8. pinned this issue on Jun 11, 2025
  9. mpkorstanje commented on Jun 11, 2025

    @mpkorstanje
    Member

    Reopened and pinned because questions keep popping up.

    Surefire moved their issues to Github. The matching issue is now apache/maven-surefire#834.

    The current workaround: Downgrade to 3.5.2

  10. pzygielo commented on Jun 11, 2025

    @pzygielo
  11. pzygielo commented on Jun 11, 2025

    @pzygielo
  12. changed the title [-]Surefire 2.5.3 does include Cucumber scenarios in test summary count[/-] [+]Surefire 3.5.3 does not include Cucumber scenarios in test summary count[/+] on Jun 11, 2025
  13. mpkorstanje commented on Jun 11, 2025

    @mpkorstanje
  14. mpkorstanje commented on Sep 5, 2025

    @mpkorstanje
    Member

    With apache/maven-surefire#828 merged we can now retest:

    Note: In their tests Surefire use cucumber.junit-platform.naming-strategy=long instead of surefire so we might have to deprecate the workaround if things have been fixed properly.

  15. self-assigned this
    on Sep 5, 2025
  16. mpkorstanje commented on Sep 14, 2025

    @mpkorstanje
    Member

    Recommended solution:

    1. Upgrade to Surefire 3.5.4
    2. Change cucumber.junit-platform.naming-strategy=surefire to cucumber.junit-platform.naming-strategy=long
  17. fslevoaca-ionos commented on Sep 15, 2025

    @fslevoaca-ionos
    Author

    Yep,
    Using surefire 2.5.4 solves current issue regardless if I use surefire or long for cucumber.junit-platform.naming-strategy property.

    Thanks !

  18. unpinned this issue on Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions