GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — With cucumber integration tests not counted in total test summary in surefire-plugin 3.5.3 · Issue #834 · apache/maven-surefire

With cucumber integration tests not counted in total test summary in surefire-plugin 3.5.3 #834

New issue
Copy link
New issue
Copy link
Closed
Closed
With cucumber integration tests not counted in total test summary in surefire-plugin 3.5.3#834
Copy link
Labels
bugSomething isn't working
Milestone
3.5.4

Description

@jamshidCo
jamshidCo
opened on Apr 16, 2025
Issue body actions

Affected version

3.5.3

Bug description

Hello,
Using JDK:

  • openjdk 21.0.5 2024-10-15 LTS
  • Apache Maven 3.9.9
  • maven surfire plugin

Issue

When running integration tests using cucumber-junit-platform-engine with maven-surefire-plugin version 3.5.3, the tests are executed and the logs are printed, but the final test summary says:

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

This behavior does not happen in version 3.5.2 — in that version, Cucumber integration tests are correctly counted in the final summary — even though Cucumber scenarios are technically not individual JUnit test methods.

But in version 3.5.3, this seems to have changed:

  • Tests still run
  • Output/logs appear
  • But Tests run: 0 appears at the end
    ➤ That can mess with CI pipelines or give misleading reports.

Expected Behavior

The final summary should include the number of Cucumber scenarios executed (like in 3.5.2).

Reacted by Fırat Küçük, philip-mosquera, Fredrik Foss, Martijn van de Rijdt, Matthias Bechtold, Sebastian Steiner, Alexander Shvetsov, Bram Klein Gunnewiek, AccsonautHristo, Gaëtan Varlet and 24 more

Activity

  1. jamshidCo
    added
    bugSomething isn't working
    on Apr 16, 2025
  2. pzygielo commented on Apr 16, 2025

    @pzygielo
    pzygielo
    on Apr 16, 2025
    Contributor
    More actions
    • SUREFIRE-2299
    • [SUREFIRE-2298] fix xml output with junit 5 nested classes (fix integration with Cucumber and Archunit) #828 (comment)
  3. juergencodes commented on Apr 25, 2025

    @juergencodes
    juergencodes
    on Apr 25, 2025
    More actions

    I experienced a similar problem: My maven build was successful though I had a test failure. Since it is in a setup of a custom framework based on JBehave it is interesting to see that others experience similar problems in cucumber (this issue) or e.g. Arch (following the links in SUREFIRE-2229).

    I was drilling down a bit deeper and found out the following reproducer that just uses DynamicTest (which probably all the above mentioned frameworks use) and plays with providing test source.

        @TestFactory
        DynamicTest withSource() {
            return test("withSource", URI.create("pom.xml"));
        }
    
        @TestFactory
        DynamicTest noSource() {
            return test("noSource", null);
        }
    
        DynamicTest test(final String test, final URI source) {
            return DynamicTest.dynamicTest(test, source, () -> {
                System.out.println("Running '" + test + "'");
                org.junit.jupiter.api.Assertions.assertNull(source);
            });
        }
    

    Running the test (also see attachment for "full" project) with surefire 3.5.2 fails as expected with

    [INFO] Running SurefireReproducerTest
    Running 'withSource'
    Running 'noSource'
    [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.049 s <<< FAILURE! -- in SurefireReproducerTest
    [ERROR] withSource().withSource -- Time elapsed: 0.012 s <<< FAILURE!
    org.opentest4j.AssertionFailedError: expected: <null> but was: <pom.xml>
            at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
            at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
            at org.junit.jupiter.api.AssertNull.failNotNull(AssertNull.java:50)
            at org.junit.jupiter.api.AssertNull.assertNull(AssertNull.java:35)
            at org.junit.jupiter.api.AssertNull.assertNull(AssertNull.java:30)
            at org.junit.jupiter.api.Assertions.assertNull(Assertions.java:279)
            at SurefireReproducerTest.lambda$test$0(SurefireReproducerTest.java:20)
            at java.base/java.util.Optional.ifPresent(Optional.java:178)
            at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
            at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
    
    [INFO]
    [INFO] Results:
    [INFO]
    [ERROR] Failures:
    [ERROR]   expected: <null> but was: <pom.xml>
    [INFO]
    [ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
    

    Switching to 3.5.3 makes

    [INFO] Running SurefireReproducerTest
    Running 'withSource'
    Running 'noSource'
    [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.049 s -- in SurefireReproducerTest
    [INFO]
    [INFO] Results:
    [INFO]
    [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
    

    Mind that both tests are executed (see "Running..." output), but

    • No error is reported
    • The build does not fail
    • The test count dropped from 2 to 1

    (just in case it matters, i used Apache Maven 3.8.6)

    Full reproducer, just make sure to bump 3.5.2 to 3.5.3
    surefire-reproducer.zip

    Reacted by Aurélien Mino, AccsonautHristo and Matthias Nisius
  4. juergencodes commented on Apr 25, 2025

    @juergencodes
    juergencodes
    on Apr 25, 2025
    More actions

    I forgot to mention that using a source or not isn't just something I was doing for fun. If you change the assertNull to assertNotNull, everythings works fine even with surefire 3.5.3

    [INFO] Running SurefireReproducerTest
    Running 'withSource'
    Running 'noSource'
    [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.048 s <<< FAILURE! -- in SurefireReproducerTest
    [ERROR] SurefireReproducerTest.noSource()[1] -- Time elapsed: 0.004 s <<< FAILURE!
    org.opentest4j.AssertionFailedError: expected: not <null>
            at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
            at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
            at org.junit.jupiter.api.AssertNotNull.failNull(AssertNotNull.java:49)
            at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:35)
            at org.junit.jupiter.api.AssertNotNull.assertNotNull(AssertNotNull.java:30)
            at org.junit.jupiter.api.Assertions.assertNotNull(Assertions.java:304)
            at SurefireReproducerTest.lambda$test$0(SurefireReproducerTest.java:20)
            at java.base/java.util.Optional.ifPresent(Optional.java:178)
            at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
            at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
    
    [INFO]
    [INFO] Results:
    [INFO]
    [ERROR] Failures:
    [ERROR]   SurefireReproducerTest.lambda$test$0:20 expected: not <null>
    [INFO]
    [ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
    

    I.e. the problem ONLY happens if one provides a source.

  5. bramklg commented on May 17, 2025

    @bramklg
    bramklg
    on May 17, 2025
    More actions

    I'm also running into this problem where unit test reports are still properly reported (and failures result in a build failure) but the (cucumber) integration test results are not recorded properly any more, it always says 0 tests executed.

    I ran into this after upgrading spring boot from 3.4.4 to 3.4.5 which includes an upgrade of the surefire plugin from 3.5.2 to 3.5.3.

  6. olamy
    marked Failsafe Plugin v3.5.3 does not detect or fail on Cucumber test failures (v3.5.2 works) #857 as a duplicate of this issue on Jun 4, 2025
  7. olamy
    marked Summary from cucumber is incorrect #853 as a duplicate of this issue on Jun 4, 2025
  8. olamy
    changed the title [-]Integration tests not counted in total test summary in surefire-plugin 3.5.3[/-] [+]With cucumber integration tests not counted in total test summary in surefire-plugin 3.5.3[/+] on Jun 4, 2025
  9. olamy
    marked Rerun results incorrectly collated with junit-platform-suite #858 as a duplicate of this issue on Jun 5, 2025
  10. olamy
    unmarked Rerun results incorrectly collated with junit-platform-suite #858 as a duplicate of this issue on Jun 5, 2025
  11. Yith1 commented on Jun 13, 2025

    @Yith1
    Yith1
    on Jun 13, 2025
    More actions

    We have had this problem. But have also noticed that ArchUnit tests are affected as well.

    Reacted by Tiemen Schut and David B.
  12. francoissey commented on Jun 13, 2025

    @francoissey
    francoissey
    on Jun 13, 2025
    More actions

    I confirm that if you downgrade to 3.5.2, it works fine. It is really 3.5.3 specific.

    Reacted by David B., philip-mosquera and Jesús Burgers
  13. ascopes commented on Jul 3, 2025

    @ascopes
    ascopes
    on Jul 3, 2025
    Contributor
    More actions

    Can also confirm 3.5.2 does not encounter the issue.

    Is there any chance of prioritising this?

    This might be caused by #816 edit: seems forcing the changed settings does not change this, so likely unrelated.

  14. claudemartin commented on Jul 7, 2025

    @claudemartin
    claudemartin
    on Jul 7, 2025
    More actions

    How is this still not fixed? I just had to rework weeks of PRs on a project because all our failing ArchUnit tests were not reported.

    Reacted by Ashley, Adam, Robert Karwowski, Yauheni Barvinski, ivu-mawi, Matthias Nisius and Dejan
  15. olamy
    marked [SUREFIRE-2299] Missing tests inside Surefire report for Cucumber scenarios #2600 as a duplicate of this issue on Jul 23, 2025
  16. ondrejfafejta-ext90099 commented on Aug 1, 2025

    @ondrejfafejta-ext90099
    ondrejfafejta-ext90099
    on Aug 1, 2025
    More actions

    I've created a minimal project that demonstrates the bug:
    https://github.com/fafejtao/cucumberSurefireBug

    Reacted by Olivier Lamy
  17. rturner-edjuster commented on Aug 27, 2025

    @rturner-edjuster
    rturner-edjuster
    on Aug 27, 2025
    More actions

    @olamy I'm just trying to understand the current status related to this issue and pull request #828. It seems you've done some work, and reverted some things (maybe), but it seems like work might be paused at the moment. Is that the correct analysis?

    Is this something that help could be used on? I can try to assist (as this issue, and the related 3.5.2 issue about parallel output being mixed up, have been driving me nuts this week).

  18. ascopes commented on Aug 27, 2025

    @ascopes
    ascopes
    on Aug 27, 2025
    Contributor
    More actions

    Would it be worth for now reverting the corresponding change that introduced the regression and then a fix being produced concurrently?

    Suggest this since I have seen this issue impact half a dozen different groups of people in the past few weeks, it seems to be causing a fair amount of noise. Especially since the issue has been active and causing build issues for over 4 months now.

  19. rturner-edjuster commented on Aug 27, 2025

    @rturner-edjuster
    rturner-edjuster
    on Aug 27, 2025
    More actions

    Would it be worth for now reverting the corresponding change that introduced the regression and then a fix being produced concurrently?
    @ascopes I'm not sure it's that simple as I believe the change that triggered this fault also fixes a pretty important data corruption issue for parallel JUnit 5 output. @olamy would be best to comment when they can as they are likely the most familiar with both issues.

    Also, since this is OSS, "we" the community need to do the work and makes the required changes. I just don't want to start a new PR if Olivier is "almost there" with a solution, nor do I want to step on anyones toes in the process. (Not that I have gone that far yet digging into the problem or a structure for a solution...)

    Reacted by Ashley
  20. olamy commented on Aug 28, 2025

    @olamy
    olamy
    on Aug 28, 2025
    Member
    More actions

    Would it be worth for now reverting the corresponding change that introduced the regression and then a fix being produced concurrently?
    @ascopes I'm not sure it's that simple as I believe the change that triggered this fault also fixes a pretty important data corruption issue for parallel JUnit 5 output. @olamy would be best to comment when they can as they are likely the most familiar with both issues.

    Also, since this is OSS, "we" the community need to do the work and make the required changes. I just don't want to start a new PR if Olivier is "almost there" with a solution, nor do I want to step on anyone's toes in the process. (Not that I have gone that far yet, digging into the problem or a structure for a solution.)

    long story short.

    The change has been introduced to fix an issue for users who have enabled parallel test running (junit.jupiter.execution.parallel.enabled=true), as test result and stacktrace were all mixed up, reverting it means reintroducing the issue for those users.
    The issue here is with the provider junit-platform (code running within the forked jvm) need to communicate in a thread safe way to a listener (which is global so common code to all providers from junit 3 to junit 5 via junit 4.x and testng) and this code is probably more than 15 years old. This main listener is fairly complicated to adapt this to the changes needed in junit-platform multi thread and doing the changes obviously broke a lot of providers (junit3/4 and testng). (not sure we really need to keep supporting 3.x though)
    Fundamentally, this would need a massive refactoring and A LOT OF code simplification. But that's another topic (I only need to express my complaints and frustrations somewhere :) )

    My first idea is to enable the change only for users who need this parallel working.
    But I wanted to have a better solution and tried something, couldn't find a quick easy change and then being distracted into other stuff :)

    so "almost-there", I plan to spend more time on this one the next few days :)

    Reacted by Kai Zander, Aurélien Mino, Dejan, Matthias Nisius, Philippe GRANET and Gaël Jourdan-Weil
  21. rturner-edjuster commented on Aug 28, 2025

    @rturner-edjuster
    rturner-edjuster
    on Aug 28, 2025
    More actions

    @olamy Thanks for the update. Please let me know if there is any assistance I can provide. I appreciate your work on this project (and others).

  22. olamy
    added a commit that references this issue on Sep 3, 2025

    Add cucumber test from apache#834

    12db137
  23. olamy commented on Sep 3, 2025

    @olamy
    olamy
    on Sep 3, 2025
    Member
    More actions

    I've created a minimal project that demonstrates the bug: https://github.com/fafejtao/cucumberSurefireBug

    @ondrejfafejta-ext90099 thanks a lot I have added your test as part of #828
    PR looking good now

    Reacted by ondrejfafejta-ext90099
  24. olamy
    added this to the 3.5.4 milestone on Sep 13, 2025
  25. olamy
    closed this as completedon Sep 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      • 3.5.4

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.