You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Stefan Bodewig <bo...@apache.org> on 2011/08/11 16:44:53 UTC

[compress] How to deal with long running test? Maven Profile?

Hi,

currently I've set the Zip64SupportTest to @Ignore because - even if you
dont have the integration test archives around - it simply takes too
long to run every time.

Using the pretty decent notebook $work has given to me the whole test
takes 45 minutes of heavy I/O load and the machine is more or less
unusable during that time.

But then again I surely want to run the tests every now and then and
adding/removing the @Ignore is cumbersome so I thought a profile was the
correct approach.

<disclaimer>
No, I'm not a mvn expert, have never been, will never be.  I don't use
mvn for anything but Compress and RAT and most things I know I have
learnt by fighting against mvn in Gump - and this is more than I ever
wanted to learn 8-)
</disclaimer>

My first attempt was to naively exclude the test in the "normal" plugins
section inside the POM and add a profile that defines the surefire
plugin without the excludes.  Excluding works fine but even if I
activate the profile the test remains excluded (I guess I can't undo a
configuration via a profile).

I suspect I'm taking an approach that is completly wrong to begin with
and that many of you around here know exactly what needs to be done.

Please enlighten me.

Stefan

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by sebb <se...@gmail.com>.
On 11 August 2011 16:32, Stefan Bodewig <bo...@apache.org> wrote:
> On 2011-08-11, sebb wrote:
>
>> Not tried this, but looks to be what you want:
>
>> http://stackoverflow.com/questions/1689242/conditionally-ignoring-tests-in-junit-4
>
> I know Assume, even use it inside the test to skip all tests that
> require the interop archives when those files are not present.
>
> For this to work I'd need to have a way to know the mvn profile was
> active while running the JUnit test.  Hmm, a system property could work.

Yes, sorry, realised after posting that I'd left that bit out...

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

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-08-11, sebb wrote:

> Not tried this, but looks to be what you want:

> http://stackoverflow.com/questions/1689242/conditionally-ignoring-tests-in-junit-4

I know Assume, even use it inside the test to skip all tests that
require the interop archives when those files are not present.

For this to work I'd need to have a way to know the mvn profile was
active while running the JUnit test.  Hmm, a system property could work.

Stefan

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by sebb <se...@gmail.com>.
On 11 August 2011 15:44, Stefan Bodewig <bo...@apache.org> wrote:
> Hi,
>
> currently I've set the Zip64SupportTest to @Ignore because - even if you
> dont have the integration test archives around - it simply takes too
> long to run every time.
>
> Using the pretty decent notebook $work has given to me the whole test
> takes 45 minutes of heavy I/O load and the machine is more or less
> unusable during that time.
>
> But then again I surely want to run the tests every now and then and
> adding/removing the @Ignore is cumbersome so I thought a profile was the
> correct approach.
>
> <disclaimer>
> No, I'm not a mvn expert, have never been, will never be.  I don't use
> mvn for anything but Compress and RAT and most things I know I have
> learnt by fighting against mvn in Gump - and this is more than I ever
> wanted to learn 8-)
> </disclaimer>
>
> My first attempt was to naively exclude the test in the "normal" plugins
> section inside the POM and add a profile that defines the surefire
> plugin without the excludes.  Excluding works fine but even if I
> activate the profile the test remains excluded (I guess I can't undo a
> configuration via a profile).
>
> I suspect I'm taking an approach that is completly wrong to begin with
> and that many of you around here know exactly what needs to be done.
>
> Please enlighten me.

Not tried this, but looks to be what you want:

http://stackoverflow.com/questions/1689242/conditionally-ignoring-tests-in-junit-4

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

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-08-11, Mark Struberg wrote:

> usually the maven-surefire-plugin will only pickup classes with the pattern *Test.java.
> You can rename the longrunning Tests to *IT.java and configure the
> surefireplugin to additionally pickup those test classes only in the
> run-its profile.

>        <configuration>
>          <includes>
>            <include>**/*Test.java</include>
>            <include>**/*IT.java</include>
>          </includes>

Ah yes, thank you, I knew there must be a simple way.

Stefan

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by Mark Struberg <st...@yahoo.de>.
usually the maven-surefire-plugin will only pickup classes with the pattern *Test.java.
You can rename the longrunning Tests to *IT.java and configure the surefireplugin to additionally pickup those test classes only in the run-its profile.

       <configuration>
         <includes>
           <include>**/*Test.java</include>
           <include>**/*IT.java</include>
         </includes>

LieGrue,
strub

--- On Thu, 8/11/11, Stefan Bodewig <bo...@apache.org> wrote:

> From: Stefan Bodewig <bo...@apache.org>
> Subject: Re: [compress] How to deal with long running test?  Maven Profile?
> To: dev@commons.apache.org
> Date: Thursday, August 11, 2011, 3:29 PM
> On 2011-08-11, Mark Struberg wrote:
> 
> > A common pattern is to introduce an own 'run-its'
> profile which
> > configures surefire to pickup those tests.
> 
> How? 8-)
> 
> Do I put the test into a separate directory and tell
> surefire inside the
> profile to look into that other dir?
> 
> > It's just not good to have tests which in summary
> takes longer than 3
> > minutes to run. This usually leads to developers
> using
> > -Dmaven.test.skip=true which is kind of counter
> productive...
> 
> Absolutely, that why I want to move them to a separate
> profile.
> 
> If you want to test reading of an archive of more than 4GB
> then you
> simply have no choice but to wait for the data to be read -
> and the
> writing tests are even worse, at least on my box.  It
> simply takes a few
> minutes just to move the data from or to the disk.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2011-08-11, Mark Struberg wrote:

> A common pattern is to introduce an own 'run-its' profile which
> configures surefire to pickup those tests.

How? 8-)

Do I put the test into a separate directory and tell surefire inside the
profile to look into that other dir?

> It's just not good to have tests which in summary takes longer than 3
> minutes to run. This usually leads to developers using
> -Dmaven.test.skip=true which is kind of counter productive...

Absolutely, that why I want to move them to a separate profile.

If you want to test reading of an archive of more than 4GB then you
simply have no choice but to wait for the data to be read - and the
writing tests are even worse, at least on my box.  It simply takes a few
minutes just to move the data from or to the disk.

Stefan

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


Re: [compress] How to deal with long running test? Maven Profile?

Posted by Mark Struberg <st...@yahoo.de>.
A common pattern is to introduce an own 'run-its' profile which configures surefire to pickup those tests.

It's just not good to have tests which in summary takes longer than 3 minutes to run. This usually leads to developers using -Dmaven.test.skip=true which is kind of counter productive...

LieGrue,
strub

--- On Thu, 8/11/11, Stefan Bodewig <bo...@apache.org> wrote:

> From: Stefan Bodewig <bo...@apache.org>
> Subject: [compress] How to deal with long running test?  Maven Profile?
> To: dev@commons.apache.org
> Date: Thursday, August 11, 2011, 2:44 PM
> Hi,
> 
> currently I've set the Zip64SupportTest to @Ignore because
> - even if you
> dont have the integration test archives around - it simply
> takes too
> long to run every time.
> 
> Using the pretty decent notebook $work has given to me the
> whole test
> takes 45 minutes of heavy I/O load and the machine is more
> or less
> unusable during that time.
> 
> But then again I surely want to run the tests every now and
> then and
> adding/removing the @Ignore is cumbersome so I thought a
> profile was the
> correct approach.
> 
> <disclaimer>
> No, I'm not a mvn expert, have never been, will never
> be.  I don't use
> mvn for anything but Compress and RAT and most things I
> know I have
> learnt by fighting against mvn in Gump - and this is more
> than I ever
> wanted to learn 8-)
> </disclaimer>
> 
> My first attempt was to naively exclude the test in the
> "normal" plugins
> section inside the POM and add a profile that defines the
> surefire
> plugin without the excludes.  Excluding works fine but
> even if I
> activate the profile the test remains excluded (I guess I
> can't undo a
> configuration via a profile).
> 
> I suspect I'm taking an approach that is completly wrong to
> begin with
> and that many of you around here know exactly what needs to
> be done.
> 
> Please enlighten me.
> 
> Stefan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 
> 

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