You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Kenny Ha <vi...@yahoo.com> on 2009/06/01 09:22:56 UTC

Re: AW: About unittest run three times

Can anyone tell me how to prevent unittest run three times when using mvn
site command??
Thanks all.


struberg wrote:
> 
> 
> Old story, and as far as I remember (please correct me if I'm wrong) the
> reason is:
> 
> The site lifecycle and the default build lifecycle are isolated things.
> So if you run mvn install, the 'test' phase will be invoked -> 1st run
> 
> Your site has a test reporting section? -> 2nd run
> 
> I assume you have cobertura or another code coverage tool enabled?
> Because this runs all the tests in an instrumended form -> 3nd run
> 
> I'm not saying this situation is optimal though ;) This especially sucks
> while running releases, because prepare and perform will do all those
> steps a few times...
> 
> LieGrue,
> strub
> 
> 
> --- forum geng <ge...@gmail.com> schrieb am Mi, 20.5.2009:
> 
>> Von: forum geng <ge...@gmail.com>
>> Betreff: About unittest run three times
>> An: users@maven.apache.org
>> Datum: Mittwoch, 20. Mai 2009, 8:30
>> Dear all,
>> 
>>            While I set
>> the nightly build command for continum by "clean
>> install site-deploy", my unit tests all run for three
>> times.
>>            And while I
>> changed to "clean install", the unit tests run for
>> one time, and changed to "clean site-deploy", my unit tests
>> run for two
>> times.
>> 
>>           Are there any to explain
>> the behind mechanism?
>>           And my requirement is
>> that to let all the unit tests run for only
>> time, and I can also find the info from the deployed site,
>> such as with
>> PMD/FindBug related report.
>> 
>> Thanks.
>> 
>> Forest.
>> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/AW%3A-About-unittest-run-three-times-tp23632984p23810914.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: AW: About unittest run three times

Posted by Stephen Connolly <st...@gmail.com>.
if you only run your tests with code coverage enabled, you cannot  
trust a passing result.

I have seen quite a number of cases where tests fail if ran standalone  
and pass with coverage. usually due to misunderstanding the java  
memory model and how the jvm spec allows optimisations

run the tests twice for your own good

Sent from my [rhymes with myPod] ;-)

On 1 Jun 2009, at 08:22, Kenny Ha <vi...@yahoo.com> wrote:

>
> Can anyone tell me how to prevent unittest run three times when  
> using mvn
> site command??
> Thanks all.
>
>
> struberg wrote:
>>
>>
>> Old story, and as far as I remember (please correct me if I'm  
>> wrong) the
>> reason is:
>>
>> The site lifecycle and the default build lifecycle are isolated  
>> things.
>> So if you run mvn install, the 'test' phase will be invoked -> 1st  
>> run
>>
>> Your site has a test reporting section? -> 2nd run
>>
>> I assume you have cobertura or another code coverage tool enabled?
>> Because this runs all the tests in an instrumended form -> 3nd run
>>
>> I'm not saying this situation is optimal though ;) This especially  
>> sucks
>> while running releases, because prepare and perform will do all those
>> steps a few times...
>>
>> LieGrue,
>> strub
>>
>>
>> --- forum geng <ge...@gmail.com> schrieb am Mi, 20.5.2009:
>>
>>> Von: forum geng <ge...@gmail.com>
>>> Betreff: About unittest run three times
>>> An: users@maven.apache.org
>>> Datum: Mittwoch, 20. Mai 2009, 8:30
>>> Dear all,
>>>
>>>            While I set
>>> the nightly build command for continum by "clean
>>> install site-deploy", my unit tests all run for three
>>> times.
>>>            And while I
>>> changed to "clean install", the unit tests run for
>>> one time, and changed to "clean site-deploy", my unit tests
>>> run for two
>>> times.
>>>
>>>           Are there any to explain
>>> the behind mechanism?
>>>           And my requirement is
>>> that to let all the unit tests run for only
>>> time, and I can also find the info from the deployed site,
>>> such as with
>>> PMD/FindBug related report.
>>>
>>> Thanks.
>>>
>>> Forest.
>>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/AW%3A-About-unittest-run-three-times-tp23632984p23810914.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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