wilx opened a new pull request, #3447:
URL: https://github.com/apache/maven-surefire/pull/3447
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:
- [x] Each commit in the pull request should have a meaningful subject line
and body.
- [x] Write a pull request description that is detailed enough to
understand what the pull request does, how, and why.
- [x] Run `mvn clean install` to make sure basic checks pass. A more
thorough check will
be performed on your pull request automatically.
- [x] 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](https://www.apache.org/licenses/icla.pdf) 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](http://www.apache.org/licenses/LICENSE-2.0)
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](http://www.apache.org/licenses/LICENSE-2.0)
- [ ] In any other case, please file an [Apache Individual Contributor
License Agreement](https://www.apache.org/licenses/icla.pdf).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]