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 — Issue with custom JUnit 5 Engine and Surefire Reporting · Issue #837 · apache/maven-surefire

Issue with custom JUnit 5 Engine and Surefire Reporting #837

New issue
Copy link
New issue
Copy link
Closed
#828
Closed
Issue with custom JUnit 5 Engine and Surefire Reporting#837
#828
Copy link
Labels
bugSomething isn't working
Milestone
3.5.4

Description

@ph33rtehgd
ph33rtehgd
opened on Apr 29, 2025
Issue body actions

Affected version

3.0.0-M4 and later

Bug description

I have written a custom JUnit 5 engine to help me run ArchUnit tests across my projects using a common set of rules. Up until version 3.0.0-M3, this engine worked with no issues and reported failures normally like any regular test case as you'd expect. However starting in 3.0.0-M4 and later Surefire no longer reports test case failures from my custom engine. For example, I would call: TestExecutionResult.failed(error) in my failure path and this should fail, however my mvn test command will finish with a success status. The only solution I've found is to either:

  1. Downgrade to 3.0.0-M3 or older of Surefire
  2. In the case of a child test case failure, mark the root descriptor as failed as well. This lets me use the latest version of Surefire, but it goes against how root descriptor reporting is supposed to work in JUnit 5 (according to their documentation) and it also results in an extra failure being recorded (root failure and the actual child test case failure).

custom-junit-engine-test.zip

Attached above is a minimal set of projects that replicate the issue. "test-custom-junit-engine" is a very simple custom JUnit engine that simply has one test that always fails. "test-project-engine" is used to run the "mvn test" command. I've left the working Surefire plugin configuration commented out. You can run mvn test as is and see that no errors are reported, however if you change the Surefire version to 3.0.0-M3 and re-run mvn test, the test failure is properly reported.

I'm hoping there is something basic I am missing here, however given that it used to work I'm a bit skeptical. Please point me in the right direction if I'm doing something incorrect.

Activity

  1. ph33rtehgd
    added
    bugSomething isn't working
    on Apr 29, 2025
  2. olamy
    added this to the 3.5.4 milestone on Sep 4, 2025
  3. olamy
    linked a pull request that will close this issue[SUREFIRE-2298] fix xml output with junit 5 nested classes (fix integration with Cucumber and Archunit) #828on Sep 4, 2025
  4. olamy
    closed this as completedin #828on Sep 4, 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.