Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.11
-
Fix Version/s: 2.12
-
Component/s: Maven Surefire Plugin
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :
Description
Let's have a single module with multiple Surefire executions (e.g. with different Arquillian configs)
Tests are divided to run in either one, using <includes> and <excludes>.
Then, if you use -Dtest=..., the specified test(s) is run twice - once for each execution (and usually fails in one of them in our scenario).
My suggestion is to introduce a Surefire config property which would make this behavior optional:
<configuration>
<ignoreIncludesOnSingleTest>false</ignoreIncludesOnSingleTest>
</configuration>
This would cause Surefire to run the intersection of the two sets -
one created by the mask from -Dtest=...,
second created by the includes and excludes of the respective execution.
Current description from http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html :
Specify this parameter to run individual tests by file name, overriding the includes/excludes parameters. Each pattern you specify here will be used to create an include pattern formatted like **/$
Unknown macro: {test}.java, so you can just type "-Dtest=MyTest" to run a single test called "foo/MyTest.java".
This parameter overrides the includes/excludes parameters, and the TestNG suiteXmlFiles parameter.
Issue Links
- is related to
-
SUREFIRE-778
failIfNoTests=false should not be required when using -Dtest=MyTestClass in multi-module reactor builds
-
This is a minimal test case that illustrates the problem.
Follow instructions in README.txt.