Copilot commented on code in PR #3653:
URL: https://github.com/apache/maven-surefire/pull/3653#discussion_r4731280954
##########
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java:
##########
@@ -454,7 +480,13 @@ private SimpleReportEntry createReportEntry(
}
StackTraceWriter stw =
testExecutionResult == null ? null :
toStackTraceWriter(className, methodName, testExecutionResult);
- String testId = testIdentifier.isTest() ? testIdentifier.getUniqueId()
: methodName;
+ // A method container, like a @ParameterizedTest, goes by its unique
id too: a nested class can have a
+ // method with the same signature, and both report under the outer
class.
+ boolean hasMethodSource = testIdentifier
+ .getSource()
+ .filter(MethodSource.class::isInstance)
+ .isPresent();
+ String testId = testIdentifier.isTest() || hasMethodSource ?
testIdentifier.getUniqueId() : methodName;
Review Comment:
The new unique-ID mappings are never evicted for skipped method containers:
`forgetTestRunId()` only removes identifiers whose `isTest()` is true, and the
new aborted-container branch does not call it at all. Disabled or aborted
parameterized tests and factories therefore retain one mapping per container
for the adapter's lifetime, including across per-class executions and reruns.
Please extend the cleanup predicate to include MethodSource containers and
invoke it after reporting an aborted container, while retaining IDs for
failures.
--
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]