[
https://issues.apache.org/jira/browse/SUREFIRE-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17511757#comment-17511757
]
Tibor Digana commented on SUREFIRE-1615:
----------------------------------------
??Though it is a user experience issue that I have no way to override behavior
from the command line since <includes> from a parent pom will always be
appended to file lists.??
You have the option. Use {{<test>CSV test patterns here</test>}} or use system
property {{-Dtest=...}} for Surefire or {{-Dit.test=...}} for Failsafe.
This is definitely a problem with parent POM in user's project.
We have integration tests for includesFile and includes.
> surefire.includesProperty is ignored
> ------------------------------------
>
> Key: SUREFIRE-1615
> URL: https://issues.apache.org/jira/browse/SUREFIRE-1615
> Project: Maven Surefire
> Issue Type: Bug
> Components: Maven Surefire Plugin
> Affects Versions: 2.22.1, 3.0.0-M2
> Environment:
> Reporter: Eddie Webb
> Assignee: Tibor Digana
> Priority: Major
>
> 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
> {code:java}
> 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{code}
> and a file like
> {code:java}
> **/BuildInfoControllerTests.java
> {code}
>
>
> When I run
> {code:java}
> ./mvnw test -B -Dsurefire.includesFile=index_test_list.txt
> {code}
> 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
> {code:java}
> [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
> {code}
> .
--
This message was sent by Atlassian Jira
(v8.20.1#820001)