You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2021/11/13 21:50:10 UTC

[GitHub] [maven-surefire] CMoH commented on a change in pull request #388: [SUREFIRE-1266] Skip junit dependency check if module has no tests to run

CMoH commented on a change in pull request #388:
URL: https://github.com/apache/maven-surefire/pull/388#discussion_r748769750



##########
File path: maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/AbstractSurefireMojo.java
##########
@@ -1101,7 +1102,7 @@ else if ( out.isDirectory() )
         }
     }
 
-    boolean verifyParameters()
+    boolean verifyParameters( boolean pluginActive )

Review comment:
       I agree the name choice is not be the best. Please note that I created this to prototype a way to solve it, as well as to point out this design issue visible in `verifyParameters()` (which does an insufficient, but speedy check, if the `test` folder exists in a module). The second, more expensive check, is done in `scanForTestClasses()`.
   
   The reasoning behind it is that some fast parameter validation can be done based purely on configuration, while a better validation can be done after inspecting the test classes, which enables more precise heuristics.
   
   This pointed me to the thought that there is an opportunity to implement these two phases: some parameters need to be checked before looking at tests, to determine if it's worth looking for tests. Next some parameters are not worth checking unless certain test providers and annotations are actually in use (the second phase).
   
   I think your decision to make is whether such a design is desirable or not. I can adjust the contribution for a better design, if desired.
   
   However, I noticed in the issue you want to solve it in a different way. Please close this merge request if you don't need it anymore.




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org