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 — [SUREFIRE-3446] Fix direct selection of JUnit Jupiter @Nested classes by wilx · Pull Request #3447 · apache/maven-surefire

Conversation

@wilx

@wilx wilx commented Aug 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Direct selection of a non-static JUnit Jupiter @Nested class stopped
discovering tests after provider-level class-name filters were added. JUnit
needs the enclosing class hierarchy to construct the selected nested test, but
an exact include for the leaf class rejected those enclosing descriptors.

This change derives the actual enclosing hierarchy from Class metadata and
allows those classes through the include filters. It deliberately does not
infer nesting from $ in the binary name, because $ is also legal in a
top-level class name. Existing post-discovery filtering continues to prevent
tests in the enclosing classes or sibling nested classes from running.

The regression coverage includes ordinary and regex includes, a legal
top-level class containing $, and a two-level nested selection whose outer
and intermediate @BeforeEach callbacks must both run. Tests in the outer,
intermediate, and sibling classes fail if selection leaks beyond the requested
leaf.

Fixes #3446

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass. A more thorough check will
    be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its clean install).

Validation performed with JDK 17:

  • mvn spotless:apply spotless:check
  • mvn -pl surefire-providers/surefire-junit-platform clean install (99 tests)
  • mvn -Prun-its -pl surefire-its -Dit.test=Surefire3446IT clean verify
  • mvn -nsu -Dmaven.build.cache.enabled=false -Prun-its clean install
    (17-module reactor; 776 integration tests, 0 failures, 0 errors)

If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.

To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

  • In any other case, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

olamy reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
wilx added 2 commits August 26, 2026 08:48
@wilx
Add failing IT for apache#3446
0e877c3
The direct selection of a JUnit Jupiter @nested class runs no tests on current master, although the same selection runs with Surefire 3.5.4.

Refs apache#3446
@wilx
[SUREFIRE-3446] Fix direct selection of nested JUnit 5 tests
7c3c705
Allow the actual enclosing class hierarchy through JUnit Platform class-name filters so a directly selected @nested class can be discovered without broadening test execution. Derive that hierarchy from Class metadata rather than binary-name parsing, and cover ordinary, regex, multi-level lifecycle, sibling, and legal dollar-sign cases.

Fixes apache#3446
@wilx

wilx commented Aug 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Verify / Verify / ubuntu-latest jdk-11-zulu 3.10.0-rc-1 (pull_request) Failing after 47s

This is a failure to download Maven artifact.

olamy reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@olamy olamy added this to the 3.6.0-M2 milestone Aug 27, 2026
@olamy olamy added the bug Something isn't working label Aug 27, 2026
@olamy
olamy merged commit 45102fa into apache:master Aug 28, 2026
27 of 28 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot assigned olamy Aug 28, 2026
@olamy olamy mentioned this pull request Aug 28, 2026
Fixing issues of new surefire mode using Junit Platform support-and-care/maven-support-and-care#246
Open
@wilx
wilx deleted the issue-3446-direct-nested-selection branch August 31, 2026 13:26
@olamy olamy mentioned this pull request Oct 8, 2026
3.6.0 leads to java.lang.IllegalAccessError (with forking/toolchain?) and very slow run (otherwise) #3511
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@olamy olamy

Labels

bug Something isn't working

Projects

None yet

Milestone

3.6.0

Development

Successfully merging this pull request may close these issues.

Direct selection of JUnit Jupiter @Nested class runs no tests since 3.6.0-M1

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@wilx @olamy
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.