Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
The current code of Maven Surefire plugin does not provide capabilities for performing method filtering on includes/excludes based on files (using surefire.excludesFile or surefire.includesFile params)
Main idea is to provide the same method filtering capabilities that we can perform nowadays using the -Dtest parameter but on the mentioned resources
Thus, if we perform mvn test -Dsurefire.excludesFile=/foo/bar/file and it is using method filtering like:
test.SomeTest#test1 test.SomeTest#test2 test.SomeTest#test3 test.SomeTest#test4 test.SomeTest#test5 test.SomeTest#test6
on a project like: https://github.com/jglick/simple-maven-project-with-tests we obtain:
Method filter prohibited in includes|excludes|includesFile|excludesFile parameter
With method filtering enabled on these parameters, we will be able to obtain
[INFO] ------------------------------------------------------- [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running test.SomeTest [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.035 s - in test.SomeTest [INFO] Running test.OtherTest [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s - in test.OtherTest [INFO] [INFO] Results: [INFO] [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.808 s [INFO] Finished at: 2021-12-03T18:00:37+01:00 [INFO] ------------------------------------------------------------------------
were test.SomeTest test methods were directly ignored.
Attachments
Attachments
Issue Links
- is related to
-
SUREFIRE-2031 Both fields/parameters "includes" and "excludes" should be in target MOJO class. User properties should be unique.
-
- Closed
-
- links to