You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dain Sundstrom (JIRA)" <ji...@codehaus.org> on 2008/03/01 21:00:28 UTC

[jira] Created: (SUREFIRE-464) Default for failIfNoTests should be false

Default for failIfNoTests should be false
-----------------------------------------

                 Key: SUREFIRE-464
                 URL: http://jira.codehaus.org/browse/SUREFIRE-464
             Project: Maven Surefire
          Issue Type: Bug
          Components: plugin
    Affects Versions: 2.4.2, 2.4.1, 2.4
            Reporter: Dain Sundstrom


In maven the surefire plugin executes by default when ever I build, and since the default for failIfNoTests is now true all of my modules must have at least one test or I must manually configure the plugin to not fail.  This is a minor annoyance for single module builds but is a major pain when you have lots of modules.  In my case it is extremely annoying since we have example modules we distribute that don't extend or parent pom (so users don't have to pull down our whole code base to get an example project).

This also means that the syntactic sugar "-Dtest=false" to turn off all testing no longer works.

At the end of the day, I don't understand why not having tests is a build failure and not just a warning.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (SUREFIRE-464) Default for failIfNoTests should be false

Posted by "Dan Fabulich (JIRA)" <ji...@codehaus.org>.
     [ http://jira.codehaus.org/browse/SUREFIRE-464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Fabulich closed SUREFIRE-464.
---------------------------------

    Resolution: Won't Fix

I think you've made some incorrect assumptions about the way failIfNoTests works.

In Surefire 2.4 we added some sweeter sugar to skip testing: -DskipTests.  (You don't even have to say "=true", just "-DskipTests" will do the trick.)

As a result, there's no reason to use -Dtest=nonexistent, -Dtest=0, -Dtest=false or whatever, so we dropped its sugary use, in favor of adding better error protection for when you're trying to use it the normal way but you make a typo, e.g. "-Dtest=MyTset".

-Dtest will cause failIfNoTests to become true in a way you can override, but the default value for failIfNoTests is actually false (because the default -Dtest is undefined).  It is already the case that the build will pass if you simply build a project that has no tests (without using -Dtest).

In summary, this bug is wrong, partly because failIfNoTests is already false by default (though it's slightly more complex than that), and partly because -Dtest=nonexistent *should* cause an error.

> Default for failIfNoTests should be false
> -----------------------------------------
>
>                 Key: SUREFIRE-464
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-464
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: plugin
>    Affects Versions: 2.4, 2.4.1, 2.4.2
>            Reporter: Dain Sundstrom
>
> In maven the surefire plugin executes by default when ever I build, and since the default for failIfNoTests is now true all of my modules must have at least one test or I must manually configure the plugin to not fail.  This is a minor annoyance for single module builds but is a major pain when you have lots of modules.  In my case it is extremely annoying since we have example modules we distribute that don't extend or parent pom (so users don't have to pull down our whole code base to get an example project).
> This also means that the syntactic sugar "-Dtest=false" to turn off all testing no longer works.
> At the end of the day, I don't understand why not having tests is a build failure and not just a warning.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (SUREFIRE-464) Default for failIfNoTests should be false

Posted by "Mark Struberg (JIRA)" <ji...@codehaus.org>.
    [ http://jira.codehaus.org/browse/SUREFIRE-464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=138001#action_138001 ] 

Mark Struberg commented on SUREFIRE-464:
----------------------------------------

I had the same problem as Dain when we upgraded from maven-2.0.4 to maven-2.0.9. 

We got a problem at building old maintenance branches. What we've done to solve this problem is to apply the failIfNoTest = false in our settings.xml, since when performing a release, or in a CI build, it should not be necessary to apply additional parameters for each single build.

{noformat}
    <profile>
      <id>oldprojects</id>
       <properties>
        <failIfNoTests>false</failIfNoTests>
      </properties>
    </profile>
{noformat}

I know this is not really cute (since ALL projects should have tests! But sadly this is not the case for a few small WARs), but at least our guys are now again able to build old projects again.

> Default for failIfNoTests should be false
> -----------------------------------------
>
>                 Key: SUREFIRE-464
>                 URL: http://jira.codehaus.org/browse/SUREFIRE-464
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: plugin
>    Affects Versions: 2.4, 2.4.1, 2.4.2
>            Reporter: Dain Sundstrom
>
> In maven the surefire plugin executes by default when ever I build, and since the default for failIfNoTests is now true all of my modules must have at least one test or I must manually configure the plugin to not fail.  This is a minor annoyance for single module builds but is a major pain when you have lots of modules.  In my case it is extremely annoying since we have example modules we distribute that don't extend or parent pom (so users don't have to pull down our whole code base to get an example project).
> This also means that the syntactic sugar "-Dtest=false" to turn off all testing no longer works.
> At the end of the day, I don't understand why not having tests is a build failure and not just a warning.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira