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

surefire.includesProperty is ignored

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.22.1, 3.0.0-M2
    • Fix Version/s: None
    • Component/s: Maven Surefire Plugin
    • Labels:
      None

      Description

      Docs say that user property for <includesFile> is `surefire.includesFile` https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#includesFile

       

      However surefire appears to ignore that file, and run all tests.

      Given a filetree

      tree src/test/
      tree src/test/
      src/test/
      └── java
          └── com
              └── edwardawebb
                  └── circleci
                      └── demo
                          ├── AClassOfVerySlowTests.java
                          ├── BuildInfoControllerTests.java
                          ├── BuildInfoTests.java
                          ├── HomeControllerTests.java
                          ├── SplittingTestBTests.java
                          └── it
                              ├── AboutPageIT.java
                              ├── AbstractWebIT.java
                              ├── HeadlessFlowTests.java
                              └── HomePageIT.java

       and a file like

      **/BuildInfoControllerTests.java
      
      
      

       

       

      When I run 

      ./mvnw test -B  -Dsurefire.includesFile=index_test_list.txt
      
      
      

      I would expect a single class be executed, instead all the tests matching the default pattern (6 of the files above)

      Actual results run all **/Test.java classes

      [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ blueskygreenbuilds ---
      [INFO] 
      [INFO] -------------------------------------------------------
      [INFO] T E S T S
      [INFO] -------------------------------------------------------
      [INFO] Running com.edwardawebb.circleci.demo.AClassOfVerySlowTests
      [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.819 s - in com.edwardawebb.circleci.demo.AClassOfVerySlowTests
      [INFO] Running com.edwardawebb.circleci.demo.BuildInfoControllerTests
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.edwardawebb.circleci.demo.BuildInfoControllerTests
      [INFO] Running com.edwardawebb.circleci.demo.BuildInfoTests
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 s - in com.edwardawebb.circleci.demo.BuildInfoTests
      [INFO] Running com.edwardawebb.circleci.demo.HomeControllerTests
      [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 s - in com.edwardawebb.circleci.demo.HomeControllerTests
      [INFO] Running com.edwardawebb.circleci.demo.it.HeadlessFlowTests
      [WARNING] Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.244 s - in com.edwardawebb.circleci.demo.it.HeadlessFlowTests
      [INFO] Running com.edwardawebb.circleci.demo.SplittingTestBTests
      [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.008 s - in com.edwardawebb.circleci.demo.SplittingTestBTests
      [INFO] 
      [INFO] Results:
      [INFO] 
      [WARNING] Tests run: 12, Failures: 0, Errors: 0, Skipped: 1
      

      .

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              eddiewebb Eddie Webb
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: