<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.30.3">
</HEAD>
<BODY>
<FONT COLOR="#000000">Hi all,</FONT><BR>
<BR>
<FONT COLOR="#000000">Thanks to John Casey, the unwanted behavior of -Dtest=... with multiple surefire executions in one module is now fixed.</FONT><BR>
<FONT COLOR="#000000">Now it will work as expected:&nbsp; The test will run only in the execution where it runs in the whole batch.</FONT><BR>
<BR>
Also note that besides <TT><FONT COLOR="#1a1a1a">SUREFIRE-806</FONT></TT>, Surefire 2.12 (which is now available in central) also fixes <BR>
<TT><FONT COLOR="#1a1a1a">SUREFIRE-803</FONT></TT><TT> - Multiple Failsafe executions - FAILURE in an execution prevents successive from running.</TT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; We have been discussing this earlier.<BR>
<TT><FONT COLOR="#1a1a1a">SUREFIRE-809</FONT></TT><TT> - Implement boolean expression to define test group to be run.</TT><BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is great improvement in possibilities of implementing large test suites in maven.<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I haven't found docs yet though.<BR>
<BR>
<FONT COLOR="#000000">Regards,</FONT><BR>
<FONT COLOR="#000000">Ondra</FONT><BR>
<BR>
<BR>
<BR>
<BR>
-------- P&#345;eposlan&#225; zpr&#225;va --------<BR>
<BLOCKQUOTE TYPE=CITE>
    <B>Od</B>: John Casey (JIRA) &lt;<A HREF="mailto:%22John%20Casey%20%28JIRA%29%22%20%3cjira@codehaus.org%3e">jira@codehaus.org</A>&gt;<BR>
    <B>Reply-to</B>: John Casey (JIRA) &lt;jira@codehaus.org&gt;<BR>
    <B>Komu</B>: <A HREF="mailto:zizka@seznam.cz">zizka@seznam.cz</A><BR>
    <B>P&#345;edm&#283;t</B>: [jira] (SUREFIRE-806) Make ignoring of &lt;includes&gt; and &lt;excludes&gt; on -Dtest=... optional (for multiple Surefire executions)<BR>
    <B>Datum</B>: Wed, 18 Jan 2012 19:00:03 +0100 (CET)<BR>
    <BR>
<PRE>
[ <A HREF="https://jira.codehaus.org/browse/SUREFIRE-806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel">https://jira.codehaus.org/browse/SUREFIRE-806?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel</A> ]

John Casey closed SUREFIRE-806.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.12

Created failIfNoSpecifiedTests parameter (-Dsurefire.failIfNoSpecifiedTests and -Dit.failIfNoSpecifiedTests when used from the CLI), which will determine whether test-execution blocks that don't contain one of the tests specified on the command line should fail the build or not. Default is to fail the build.

Also, in cases where there are multiple test execution blocks, to avoid running a specified test in the wrong block, the existing includes/excludes are now honored...the specified tests now act as a refining filter on these includes/excludes. This means that in cases where there are multiple test-execution blocks, you cannot run a test that wouldn't ordinarily be run by just using -Dtest=... any more.

In cases where there is only a single test-execution block, the specified tests should override the includes as before.

I also added three new integration tests to verify all of this behavior.
                
&gt; Make ignoring of &lt;includes&gt; and &lt;excludes&gt; on -Dtest=... optional (for multiple Surefire executions)
&gt; ----------------------------------------------------------------------------------------------------
&gt;
&gt;                 Key: SUREFIRE-806
&gt;                 URL: <A HREF="https://jira.codehaus.org/browse/SUREFIRE-806">https://jira.codehaus.org/browse/SUREFIRE-806</A>
&gt;             Project: Maven Surefire
&gt;          Issue Type: Improvement
&gt;          Components: Maven Surefire Plugin
&gt;    Affects Versions: 2.11
&gt;            Reporter: Ondrej Zizka
&gt;            Assignee: John Casey
&gt;             Fix For: 2.12
&gt;
&gt;         Attachments: surefire-806-testParam-hits-all-executions.zip
&gt;
&gt;
&gt; Let's have a single module with multiple Surefire executions (e.g. with different Arquillian configs)
&gt; Tests are divided to run in either one, using &lt;includes&gt; and &lt;excludes&gt;.
&gt; 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).
&gt; My suggestion is to introduce a Surefire config property which would make this behavior optional:
&gt; {code}
&gt; &lt;configuration&gt;
&gt;   &lt;ignoreIncludesOnSingleTest&gt;false&lt;/ignoreIncludesOnSingleTest&gt;
&gt; &lt;/configuration&gt;
&gt; {code}
&gt; This would cause Surefire to run the intersection of the two sets -
&gt; one created by the mask from -Dtest=...,
&gt; second created by the includes and excludes of the respective execution.
&gt; Current description from <A HREF="http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html">http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html</A> :
&gt; {quote}
&gt; 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 **/${test}.java, so you can just type &quot;-Dtest=MyTest&quot; to run a single test called &quot;foo/MyTest.java&quot;.
&gt; This parameter overrides the includes/excludes parameters, and the TestNG suiteXmlFiles parameter.
&gt; {quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: <A HREF="https://jira.codehaus.org/secure/ContactAdministrators!default.jspa">https://jira.codehaus.org/secure/ContactAdministrators!default.jspa</A>
For more information on JIRA, see: <A HREF="http://www.atlassian.com/software/jira">http://www.atlassian.com/software/jira</A>

        
</PRE>
</BLOCKQUOTE>
<BR>
<BR>
</BODY>
</HTML>