You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Dave Neuer <dn...@BodyMedia.Com> on 2005/11/02 23:55:02 UTC
[m2] Problem: How to run some tests only sometimes
So, here's my situation, I really hope someone can help figure out how
to do this.
I have currently got 2 projects, one's a library, the other is more like
an application, and depends on the library. The lib project tests only
use Mocks, because they're "common" objects not tied to a product or
database instance.
The "app" project depends on both the lib jar and the lib-test jar (in
order to reuse abstract test logic. This has been working great since
the test-jar feature was added in beta 3.
Now, unfortunately, some of our tests in the "app" take a LOOOOONNNNG
time to run (i.e., tests that insert hundreds of thousands of rows into
the DB).
We really don't want to be in a situation where the tests take so long
to run that developers don't run them, thereby checking in buggy code.
So, the idea was we'd separate out the horrendously long ones and run
them nightly or something.
Problem is, I can't figure out a good way to do this. "Lib" and "app"
are both modules in a top level project, normally we do "mvn install"
from the top-level directory to run all of the tests.
So, if I add another project "long tests" as a module, the long tests
will be run each time by the developers. If I don't add it as a module
in the top-level project, running it in its own directory requires that
the other modules' jars are installed -- which is fine except that once
that is done once, it won't automatically be done again, and so changes
in the other projects won't be picked up.
So is there a way, either with profiles w/ a different test name
pattern, or declaring the top-level pom as a parent in the "long running
test" project, to ensure that the other projects are built fresh when
the long tests are run?
Thanks in advance.
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: [m2] Problem: How to run some tests only sometimes
Posted by Brett Porter <br...@gmail.com>.
Dave is right that profiles are the right way to go about this.
You can change the includes/excludes of the test plugin (or even skip
them all for a project) based on the profile in use.
- Brett
On 11/3/05, Brill Pappin <jo...@gmail.com> wrote:
> I used to do this with a special goal in the maven.xml but since it no
> longer graces m2, I would love to hear a solution as well.
>
> - Brill Pappin
>
> On 11/2/05, Dave Neuer <dn...@bodymedia.com> wrote:
> >
> > So, here's my situation, I really hope someone can help figure out how
> > to do this.
> >
> > I have currently got 2 projects, one's a library, the other is more like
> > an application, and depends on the library. The lib project tests only
> > use Mocks, because they're "common" objects not tied to a product or
> > database instance.
> >
> > The "app" project depends on both the lib jar and the lib-test jar (in
> > order to reuse abstract test logic. This has been working great since
> > the test-jar feature was added in beta 3.
> >
> > Now, unfortunately, some of our tests in the "app" take a LOOOOONNNNG
> > time to run (i.e., tests that insert hundreds of thousands of rows into
> > the DB).
> >
> > We really don't want to be in a situation where the tests take so long
> > to run that developers don't run them, thereby checking in buggy code.
> > So, the idea was we'd separate out the horrendously long ones and run
> > them nightly or something.
> >
> > Problem is, I can't figure out a good way to do this. "Lib" and "app"
> > are both modules in a top level project, normally we do "mvn install"
> > from the top-level directory to run all of the tests.
> >
> > So, if I add another project "long tests" as a module, the long tests
> > will be run each time by the developers. If I don't add it as a module
> > in the top-level project, running it in its own directory requires that
> > the other modules' jars are installed -- which is fine except that once
> > that is done once, it won't automatically be done again, and so changes
> > in the other projects won't be picked up.
> >
> > So is there a way, either with profiles w/ a different test name
> > pattern, or declaring the top-level pom as a parent in the "long running
> > test" project, to ensure that the other projects are built fresh when
> > the long tests are run?
> >
> > Thanks in advance.
> >
> > Dave
> >
> > ---------------------------------------------------------------------
> > 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: [m2] Problem: How to run some tests only sometimes
Posted by Brill Pappin <jo...@gmail.com>.
I used to do this with a special goal in the maven.xml but since it no
longer graces m2, I would love to hear a solution as well.
- Brill Pappin
On 11/2/05, Dave Neuer <dn...@bodymedia.com> wrote:
>
> So, here's my situation, I really hope someone can help figure out how
> to do this.
>
> I have currently got 2 projects, one's a library, the other is more like
> an application, and depends on the library. The lib project tests only
> use Mocks, because they're "common" objects not tied to a product or
> database instance.
>
> The "app" project depends on both the lib jar and the lib-test jar (in
> order to reuse abstract test logic. This has been working great since
> the test-jar feature was added in beta 3.
>
> Now, unfortunately, some of our tests in the "app" take a LOOOOONNNNG
> time to run (i.e., tests that insert hundreds of thousands of rows into
> the DB).
>
> We really don't want to be in a situation where the tests take so long
> to run that developers don't run them, thereby checking in buggy code.
> So, the idea was we'd separate out the horrendously long ones and run
> them nightly or something.
>
> Problem is, I can't figure out a good way to do this. "Lib" and "app"
> are both modules in a top level project, normally we do "mvn install"
> from the top-level directory to run all of the tests.
>
> So, if I add another project "long tests" as a module, the long tests
> will be run each time by the developers. If I don't add it as a module
> in the top-level project, running it in its own directory requires that
> the other modules' jars are installed -- which is fine except that once
> that is done once, it won't automatically be done again, and so changes
> in the other projects won't be picked up.
>
> So is there a way, either with profiles w/ a different test name
> pattern, or declaring the top-level pom as a parent in the "long running
> test" project, to ensure that the other projects are built fresh when
> the long tests are run?
>
> Thanks in advance.
>
> Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>