You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Eric Pugh <ep...@upstate.com> on 2004/09/07 21:01:00 UTC

Property to run Unit Tests only once?

Hi all,

I've been faced in various situations where I am running the unit tests over
and over..  The typical situation is when I do a deploy, I build the
artifact, and then build the site docs.  This means the unit tests are run
at least twice.  However, as far as the site docs are concerned, they only
need the test-reports/ directory to be populated.  I was thinking of adding
a property to the junit-report plugin that was called something like:

maven.junit.test.runonce

If true, and the xml unit test files existed, then they would be used, other
if set to false, or the files are missing then the test:test goal would be
called...?


Alternatively, I was kicking around adding

maven.test.runonce

and if that is true, then the test:test goal would only run if it hadn't run
before..  I am doing something similiar by putting a postGoal on test:test
in my individual maven.xml files:

  <postGoal name="test:test">
   	<j:set var="maven.test.skip" value="true"/>
  </postGoal>

I'm also playing around with just including the Jcoverage report and the
Junit report elements, as the xml generated by JCoverage is all that is
needed for Junit report to do it's thing.

Opinions?

Eric Pugh


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


RE: Property to run Unit Tests only once?

Posted by Eric Pugh <ep...@upstate.com>.
okay...   Cool..  I seemed to remember this being discussed earlier, and
couldn't quite recall the resolution..  One other, maybe related issue is
that it is possible via pregoals to great infinite loops..   I guess that
would be resolved by changing the session behavior as well?

Eric

> -----Original Message-----
> From: Brett Porter [mailto:brett@apache.org]
> Sent: Wednesday, September 08, 2004 1:54 AM
> To: Maven Developers List; epugh@upstate.com
> Subject: Re: Property to run Unit Tests only once?
>
>
> We've discused this before, and the resolution is that I'm going
> to change the
> default session behaviour in maven 1.1 so that it only runs once.
> It's an easy
> fix, but it will break stuff.
>
> - Brett
>
> Quoting Eric Pugh <ep...@upstate.com>:
>
> > Hi all,
> >
> > I've been faced in various situations where I am running the
> unit tests over
> > and over..  The typical situation is when I do a deploy, I build the
> > artifact, and then build the site docs.  This means the unit
> tests are run
> > at least twice.  However, as far as the site docs are
> concerned, they only
> > need the test-reports/ directory to be populated.  I was
> thinking of adding
> > a property to the junit-report plugin that was called something like:
> >
> > maven.junit.test.runonce
> >
> > If true, and the xml unit test files existed, then they would
> be used, other
> > if set to false, or the files are missing then the test:test
> goal would be
> > called...?
> >
> >
> > Alternatively, I was kicking around adding
> >
> > maven.test.runonce
> >
> > and if that is true, then the test:test goal would only run if
> it hadn't run
> > before..  I am doing something similiar by putting a postGoal
> on test:test
> > in my individual maven.xml files:
> >
> >   <postGoal name="test:test">
> >    	<j:set var="maven.test.skip" value="true"/>
> >   </postGoal>
> >
> > I'm also playing around with just including the Jcoverage report and the
> > Junit report elements, as the xml generated by JCoverage is all that is
> > needed for Junit report to do it's thing.
> >
> > Opinions?
> >
> > Eric Pugh
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


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


Re: Property to run Unit Tests only once?

Posted by Brett Porter <br...@apache.org>.
We've discused this before, and the resolution is that I'm going to change the
default session behaviour in maven 1.1 so that it only runs once. It's an easy
fix, but it will break stuff.

- Brett

Quoting Eric Pugh <ep...@upstate.com>:

> Hi all,
> 
> I've been faced in various situations where I am running the unit tests over
> and over..  The typical situation is when I do a deploy, I build the
> artifact, and then build the site docs.  This means the unit tests are run
> at least twice.  However, as far as the site docs are concerned, they only
> need the test-reports/ directory to be populated.  I was thinking of adding
> a property to the junit-report plugin that was called something like:
> 
> maven.junit.test.runonce
> 
> If true, and the xml unit test files existed, then they would be used, other
> if set to false, or the files are missing then the test:test goal would be
> called...?
> 
> 
> Alternatively, I was kicking around adding
> 
> maven.test.runonce
> 
> and if that is true, then the test:test goal would only run if it hadn't run
> before..  I am doing something similiar by putting a postGoal on test:test
> in my individual maven.xml files:
> 
>   <postGoal name="test:test">
>    	<j:set var="maven.test.skip" value="true"/>
>   </postGoal>
> 
> I'm also playing around with just including the Jcoverage report and the
> Junit report elements, as the xml generated by JCoverage is all that is
> needed for Junit report to do it's thing.
> 
> Opinions?
> 
> Eric Pugh
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 



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