olamy commented on code in PR #3653:
URL: https://github.com/apache/maven-surefire/pull/3653#discussion_r4749384869
##########
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java:
##########
@@ -257,6 +266,31 @@ private void reportAbortedClass(
}
}
+ /**
+ * A method container, like a {@code @ParameterizedTest} or a {@code
@TestFactory}, none of whose invocations got
+ * registered. Invocations that did run were reported on their own, so the
container must not be counted again.
+ * Neither must it when a dynamic container inside it was already counted.
+ */
+ private boolean isMethodContainerWithoutTests(TestIdentifier
testIdentifier) {
+ TestPlan currentTestPlan = testPlan;
+ return
testIdentifier.getSource().filter(MethodSource.class::isInstance).isPresent()
+ && (currentTestPlan == null
+ ||
currentTestPlan.getDescendants(testIdentifier).stream()
+ .noneMatch(d -> d.isTest() ||
countedAbortedContainers.contains(d.getUniqueId())));
Review Comment:
Good catch, fixed in e4cdb8ce7. The set is now `reportedContainers`, and it
records failed containers as well as aborted ones. So a factory that aborts
after one of its dynamic containers failed isn't counted on top of that error.
`abortedFactoryIsNotCountedAfterItsFailedDynamicContainer` is the failed-child
variant, and it shares a helper with the aborted one.
--
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]