Uploaded image for project: 'Maven Surefire'
  1. Maven Surefire
  2. SUREFIRE-1964

Method filtering support on excludes and includes file

    XMLWordPrintableJSON

Details

    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

        Issue Links

          Activity

            People

              tibordigana Tibor Digana
              imontero Ildefonso Montero
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: