MaxonT commented on code in PR #3659:
URL: https://github.com/apache/maven-surefire/pull/3659#discussion_r4807695564


##########
maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java:
##########
@@ -1292,7 +1292,9 @@ private DefaultScanResult scanDirectories() throws 
MojoFailureException {
     }
 
     List<Artifact> getProjectTestArtifacts() {
-        return project.getTestArtifacts();
+        return project.getArtifacts().stream()
+                .filter(artifact -> 
artifact.getArtifactHandler().isAddedToClasspath())
+                .collect(Collectors.toList());

Review Comment:
   Status on head 9aeef3e9: the automated review asked for a direct test of the 
production selection logic. 
`AbstractSurefireMojoTest#selectsClasspathArtifactsInEncounterOrder` now calls 
the production `getProjectTestArtifacts()` body through 
`productionProjectTestArtifacts()`, bypassing the test override. It covers 
exclusion of an artifact whose handler has `isAddedToClasspath()` false, order 
and identity of the eligible artifacts, and an empty set. 
`AbstractSurefireMojoTest` ran 45 tests with 0 failures and 0 errors on the 
ubuntu jdk-17 Verify job.
   
   The `Verify / windows-latest jdk-8-zulu` job failed on this head in 
`CheckTestFailIfNoTestsForkCountIT.dontFailIfNoTestsForkOnce`; the last five 
Verify runs on master passed that job, and I have not found the cause yet. The 
other Verify jobs on this head passed.



-- 
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]

Reply via email to