aghoussaini opened a new pull request, #3430:
URL: https://github.com/apache/maven-surefire/pull/3430
RunListenerAdapter walked the test plan through
TestIdentifier#getParentIdObject, which exists only from JUnit Platform 1.8
and was therefore looked up reflectively. On an older platform the lookup
returns nothing, findTopParent hands back the identifier it was given and the
class level name stays empty, so tests whose descriptors carry no ClassSource
are attributed to the display name of their parent instead of to their test
class. Cucumber scenarios are the common case.
The per source statistics introduced by SUREFIRE-1643 are keyed on that
name, so the scenarios accumulate under the feature name while the test set
completes under the runner class. The two buckets never meet and the test set
is reported as having run nothing: "Tests run: 0" on the console and tests="0"
with no testcase elements in the XML report.
TestPlan#getParent has been part of the launcher API since 1.0 and returns
the same identifier, so use it and drop the reflection.
Add an integration test pinning junit-bom 5.7.2 to cover the case, and a
unit test for the Vintage hierarchy that Cucumber produces.
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`).
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]