You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Eric Berenguier <eb...@octo.com> on 2003/11/25 15:04:06 UTC

Unit tests run twice ?

Hi,

I'd like to write a single goal that install jar to repository and 
produce the maven site:
So i wrote something like this :

<goal name="myGoal">
    <attainGoal name="jar:install"/>
    <attainGoal name="site:generate"/>
</goal>

It works but both jar:install and site:generate call the test:test goal, 
so i have my unit tests run twice.
It's a real problem when unit tests take a long time to run.

Am i missing something ?
            
Eric Berenguier


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Unit tests run twice ?

Posted by Vincent Massol <vm...@pivolis.com>.

> -----Original Message-----
> From: Eric Berenguier [mailto:eberenguier@octo.com]
> Sent: 25 November 2003 16:14
> To: Maven Users List
> Subject: Re: Unit tests run twice ?
> 
> >     <property name='maven.test.skip' value='true'/>
> 
> >>>
> > I tried that too, but it doesn't work (test are still run twice).
> 
> As far i understand, properties can't be changed after being set,

No. This is true for Maven but not for Jelly.

> and
> the test plugin sets this to false. So the only way to change this
> property is to run "maven -Dmaven.test.skip=true myGoal " (or put this
> in a build.properties or project.properties), but then i can't run any
> unit test at all.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unit tests run twice ?

Posted by Eric Berenguier <eb...@octo.com>.
>     <property name='maven.test.skip' value='true'/> 

>>>
> I tried that too, but it doesn't work (test are still run twice). 

As far i understand, properties can't be changed after being set, and 
the test plugin sets this to false. So the only way to change this 
property is to run "maven -Dmaven.test.skip=true myGoal " (or put this 
in a build.properties or project.properties), but then i can't run any 
unit test at all.




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unit tests run twice ?

Posted by Eric Berenguier <eb...@octo.com>.
Tomasz Pik wrote:

> Maybe this help (sorry, not tested):
>
>> <goal name="myGoal">
>>    <attainGoal name="jar:install"/>
>
>     <property name='maven.test.skip' value='true'/>
>
>>    <attainGoal name="site:generate"/>
>> </goal>
>>

Thanks for your answer,

I tried that too, but it doesn't work (test are still run twice).

Eric



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unit tests run twice ?

Posted by Tomasz Pik <pi...@ais.pl>.
Eric Berenguier wrote:

> Hi,

Hi,

Maybe this help (sorry, not tested):

> I'd like to write a single goal that install jar to repository and 
> produce the maven site:
> So i wrote something like this :
> 
> <goal name="myGoal">
>    <attainGoal name="jar:install"/>

     <property name='maven.test.skip' value='true'/>

>    <attainGoal name="site:generate"/>
> </goal>
> 
> It works but both jar:install and site:generate call the test:test goal, 
> so i have my unit tests run twice.
> It's a real problem when unit tests take a long time to run.
> 
> Am i missing something ?
>            Eric Berenguier

Tomek




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Unit tests run twice ?

Posted by Paul Libbrecht <pa...@activemath.org>.
I think the solution is to use lazyAttainGoal instead of attainGoal... 
but I never got it to work and I don't know wether an RC2 will repair 
this.
Then plugin-writers will be able to make use of it instead of making 
use of attainGoal or of prereqs (which is equivalent if I don't 
mistake).

paul



On Mardi, nove 25, 2003, at 15:04 Europe/Paris, Eric Berenguier wrote:

> Hi,
>
> I'd like to write a single goal that install jar to repository and 
> produce the maven site:
> So i wrote something like this :
>
> <goal name="myGoal">
>    <attainGoal name="jar:install"/>
>    <attainGoal name="site:generate"/>
> </goal>
>
> It works but both jar:install and site:generate call the test:test 
> goal, so i have my unit tests run twice.
> It's a real problem when unit tests take a long time to run.
>
> Am i missing something ?
>            Eric Berenguier


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org