[ 
https://jira.codehaus.org/browse/SUREFIRE-856?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=340308#comment-340308
 ] 

Sean Colyer commented on SUREFIRE-856:
--------------------------------------

This seems to still be an issue. Diving somewhat in depth into the problem it 
seems tied to 
{{org.apache.maven.plugin.surefire.AbstractSurefireMojo.java:1578}}
{code}
if ( isSpecificTestSpecified() && !isMultipleExecutionBlocksDetected() )
{code}

This shows itself within 
{{org.apache.maven.plugin.surefire.util.DirectoryScanner#scan}} where the 
{{specificTests}} are processed into a filter, and then the available classes 
are filtered down by what is in the {{includes}} list. The issue scenario for 
this ticket occurs when the {{includes}} does not include the {{specificTests}} 
specified via CLI.

I'm not sure I follow the explanation for a scenario where you would ever want 
to manually say something like: {{mvn test -Dtest=RandomTestName}} and the test 
not to be run. I understand the value of different executions, but don't see 
the value in having them override all CLI arguments.

Should I attach a patch here if what I'm saying is not clear?


> Running single test in Failsafe using CLI does not override <includes> 
> configuration
> ------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-856
>                 URL: https://jira.codehaus.org/browse/SUREFIRE-856
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Failsafe Plugin
>    Affects Versions: 2.12
>         Environment: Mac OS X 10.7, Maven 3.0.3, JDK 1.7.0_04-ea
>            Reporter: David Drake
>            Priority: Minor
>
> h4. Description
> If a single test is specified from using CLI parameters, but the test does 
> not match the <includes> pattern for failsafe, then the test will not run.  
> This is different from the behavior for the surefire plugin, which will run 
> any test specified using CLI parameters.  If the test does match the 
> <includes> pattern for failsafe, then it will run.
> h4. Reproduction steps
> # Create a project with a single test named "Sample.java".
> # Add the following block to the failsafe configuration:
> {code:xml} 
> <includes> 
>   <include>**/Sample.java</include>
> </includes> 
> {code} 
> # Run "mvn clean verify -Dit.test=Sample" from the command line (and verify 
> that test runs).
> # Remove the <includes> block shown above from the pom.
> # Run "mvn clean verify -Dit.test=Sample" from the command line.
> h4. Expected results
> Sample test is run, as before, and no other tests are run.
> h4. Actual results
> No tests are run.



--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to