You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by nicolas de loof <ni...@apache.org> on 2007/12/13 14:58:13 UTC

[MECLIPSE] refactor IT tests to use shitty maven plugin ?

Hello

I tried to look at maven-eclipse-plugin tests and was really confused on
it's testing framework complexity.

What about moving thoses IT tests to src/it via the Shitty maven plugin (
http://mojo.codehaus.org/shitty-maven-plugin/usage.html)
I allready used it and found it simple to use and very powerfull.
The only difficulty AFAIK is to refactor the generated file verification to
be used from validate.groovy scripts.


I also got some errors running the tests as my local repo contains some
source jars, so the generated .classpath files does not match the expected
ones.

Maybe those tests should rely on a test localrepository and a test
remoterepository to avoid such false-failures

Nico.

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by Arnaud HERITIER <ah...@gmail.com>.
I understand. I had the same problem at the beginning.
When it works you can also check that you didn't brake the continuous
integration.
http://maven.zones.apache.org/continuum/buildResults.action?projectId=17&projectGroupId=2
For the Shitty plugin I'm in favor to use it (I also uses it in other
plugins I'm working on) .
The problem is with existing patchs posted by the community.


On Dec 13, 2007 3:17 PM, nicolas de loof <ni...@apache.org> wrote:

> To be honest, my initial goal was to fix some Jira issues, but as some
> tests
> fail on my environment its difficult to know if I introduced some new
> issues
> or not.
>
> I've attached a patch on MECLIPSE-101 as a proof of concept on moving
> project-01 IT test to SHITTY.
>
>
> 2007/12/13, Arnaud HERITIER <ah...@gmail.com>:
> >
> > Tests defined in the eclipse plugin have to be completely refactored.
> > With the shitty plugin why not.
> > I already opened several issues to separate unit and integration tests
> and
> > also to refactor the plugin itself.
> > Actually, I don't want to begin all those changes if we didn't finish to
> > apply/reject existing patchs in Jira.
> > I'm working on MECLIPSE-344. If you want to help me to cleanup Jira ;-)
> >
> > Arnaud
> >
> > On Dec 13, 2007 2:58 PM, nicolas de loof <ni...@apache.org> wrote:
> >
> > > Hello
> > >
> > > I tried to look at maven-eclipse-plugin tests and was really confused
> on
> > > it's testing framework complexity.
> > >
> > > What about moving thoses IT tests to src/it via the Shitty maven
> plugin
> > (
> > > http://mojo.codehaus.org/shitty-maven-plugin/usage.html)
> > > I allready used it and found it simple to use and very powerfull.
> > > The only difficulty AFAIK is to refactor the generated file
> verification
> > > to
> > > be used from validate.groovy scripts.
> > >
> > >
> > > I also got some errors running the tests as my local repo contains
> some
> > > source jars, so the generated .classpath files does not match the
> > expected
> > > ones.
> > >
> > > Maybe those tests should rely on a test localrepository and a test
> > > remoterepository to avoid such false-failures
> > >
> > > Nico.
> > >
> >
> >
> >
> > --
> > ..........................................................
> > Arnaud HERITIER
> > ..........................................................
> > OCTO Technology - aheritier AT octo DOT com
> > www.octo.com | blog.octo.com
> > ..........................................................
> > ASF - aheritier AT apache DOT org
> > www.apache.org | maven.apache.org
> > ...........................................................
> >
>



-- 
..........................................................
Arnaud HERITIER
..........................................................
OCTO Technology - aheritier AT octo DOT com
www.octo.com | blog.octo.com
..........................................................
ASF - aheritier AT apache DOT org
www.apache.org | maven.apache.org
...........................................................

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by nicolas de loof <ni...@apache.org>.
To be honest, my initial goal was to fix some Jira issues, but as some tests
fail on my environment its difficult to know if I introduced some new issues
or not.

I've attached a patch on MECLIPSE-101 as a proof of concept on moving
project-01 IT test to SHITTY.


2007/12/13, Arnaud HERITIER <ah...@gmail.com>:
>
> Tests defined in the eclipse plugin have to be completely refactored.
> With the shitty plugin why not.
> I already opened several issues to separate unit and integration tests and
> also to refactor the plugin itself.
> Actually, I don't want to begin all those changes if we didn't finish to
> apply/reject existing patchs in Jira.
> I'm working on MECLIPSE-344. If you want to help me to cleanup Jira ;-)
>
> Arnaud
>
> On Dec 13, 2007 2:58 PM, nicolas de loof <ni...@apache.org> wrote:
>
> > Hello
> >
> > I tried to look at maven-eclipse-plugin tests and was really confused on
> > it's testing framework complexity.
> >
> > What about moving thoses IT tests to src/it via the Shitty maven plugin
> (
> > http://mojo.codehaus.org/shitty-maven-plugin/usage.html)
> > I allready used it and found it simple to use and very powerfull.
> > The only difficulty AFAIK is to refactor the generated file verification
> > to
> > be used from validate.groovy scripts.
> >
> >
> > I also got some errors running the tests as my local repo contains some
> > source jars, so the generated .classpath files does not match the
> expected
> > ones.
> >
> > Maybe those tests should rely on a test localrepository and a test
> > remoterepository to avoid such false-failures
> >
> > Nico.
> >
>
>
>
> --
> ..........................................................
> Arnaud HERITIER
> ..........................................................
> OCTO Technology - aheritier AT octo DOT com
> www.octo.com | blog.octo.com
> ..........................................................
> ASF - aheritier AT apache DOT org
> www.apache.org | maven.apache.org
> ...........................................................
>

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by Arnaud HERITIER <ah...@gmail.com>.
Tests defined in the eclipse plugin have to be completely refactored.
With the shitty plugin why not.
I already opened several issues to separate unit and integration tests and
also to refactor the plugin itself.
Actually, I don't want to begin all those changes if we didn't finish to
apply/reject existing patchs in Jira.
I'm working on MECLIPSE-344. If you want to help me to cleanup Jira ;-)

Arnaud

On Dec 13, 2007 2:58 PM, nicolas de loof <ni...@apache.org> wrote:

> Hello
>
> I tried to look at maven-eclipse-plugin tests and was really confused on
> it's testing framework complexity.
>
> What about moving thoses IT tests to src/it via the Shitty maven plugin (
> http://mojo.codehaus.org/shitty-maven-plugin/usage.html)
> I allready used it and found it simple to use and very powerfull.
> The only difficulty AFAIK is to refactor the generated file verification
> to
> be used from validate.groovy scripts.
>
>
> I also got some errors running the tests as my local repo contains some
> source jars, so the generated .classpath files does not match the expected
> ones.
>
> Maybe those tests should rely on a test localrepository and a test
> remoterepository to avoid such false-failures
>
> Nico.
>



-- 
..........................................................
Arnaud HERITIER
..........................................................
OCTO Technology - aheritier AT octo DOT com
www.octo.com | blog.octo.com
..........................................................
ASF - aheritier AT apache DOT org
www.apache.org | maven.apache.org
...........................................................

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by Stephane Nicoll <st...@gmail.com>.
On Dec 17, 2007 7:40 AM, nicolas de loof <ni...@apache.org> wrote:
> Couldn't those two plugins merge ? They are so similar !

For the love of God, please! :)

Stéphane

-- 
Large Systems Suck: This rule is 100% transitive. If you build one,
you suck" -- S.Yegge

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


Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by nicolas de loof <ni...@apache.org>.
I just looked at invoker plugin as part of maven-jar-plugin it tests.
Looks very similar to shitty, just two diffs :

- shitty handles installing a test jar in the local repo. Invoker requires
more conf in POM to install the jar in a custom local repo (the way it is
used in MJAR)
- shitty uses groovy for verify scripts, verifier uses beanshell.
Both accept standard Java.

Couldn't those two plugins merge ? They are so similar !


2007/12/14, nicolas de loof <ni...@apache.org>:
>
> Not sure to understand, maybe I miss-used testing-harness :
>
> I set a test POM with just the plugin configuration, so that I can run :
>
>         File testPom = new File( getBasedir(),
> "src/test/resources/compile.pom" );
>         Mojo mojo = (Mojo) lookupMojo( "compile", testPom );
>         assertNotNull( "Failed to configure the plugin", mojo );
>         mojo.execute();
>
> Right, but then when my plugin has many plexus @component I have to set
> them in the test POM as configuration elements, using
> implementation="XXXStub". So it seems this NOT to be a real maven build. The
> EclipsePlugin requires a MavenProject with many sub-components, that is
> difficult to setup
>
> Or maybe I missunderstood the use of this plugin ?
>
> Nico.
>
>
> 2007/12/14, Brian E. Fox <br...@reply.infinity.nu>:
> >
> >
> > >AFAIK, shitty is similar to invoker, but does more : it install the
> > current
> > >artifact in local repo with version "testing" and invoke a maven build.
> >
> > >Seems to be what the invoker it-test do. Shitty alos use groovy scripts
> > to
> > >test the result.
> >
> > This is _exactly_ what the plugin testing harness (currently used by the
> > eclipse plugin) does.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by nicolas de loof <ni...@apache.org>.
Not sure to understand, maybe I miss-used testing-harness :

I set a test POM with just the plugin configuration, so that I can run :

        File testPom = new File( getBasedir(),
"src/test/resources/compile.pom" );
        Mojo mojo = (Mojo) lookupMojo( "compile", testPom );
        assertNotNull( "Failed to configure the plugin", mojo );
        mojo.execute();

Right, but then when my plugin has many plexus @component I have to set them
in the test POM as configuration elements, using implementation="XXXStub".
So it seems this NOT to be a real maven build. The EclipsePlugin requires a
MavenProject with many sub-components, that is difficult to setup

Or maybe I missunderstood the use of this plugin ?

Nico.


2007/12/14, Brian E. Fox <br...@reply.infinity.nu>:
>
>
> >AFAIK, shitty is similar to invoker, but does more : it install the
> current
> >artifact in local repo with version "testing" and invoke a maven build.
> >Seems to be what the invoker it-test do. Shitty alos use groovy scripts
> to
> >test the result.
>
> This is _exactly_ what the plugin testing harness (currently used by the
> eclipse plugin) does.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

RE: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>AFAIK, shitty is similar to invoker, but does more : it install the
current
>artifact in local repo with version "testing" and invoke a maven build.
>Seems to be what the invoker it-test do. Shitty alos use groovy scripts
to
>test the result.

This is _exactly_ what the plugin testing harness (currently used by the
eclipse plugin) does.

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


Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by nicolas de loof <ni...@apache.org>.
I've never used invoker or verifier, so still have to make my opinion.

I just had many issues configuring testing-harness with required maven
components : I added new feature to my mojos but tests cannot be updated due
to some new dependencies introduced that have no stub in testing-harness (or
no easy way to get one).
Shitty was an easy way to solve this.

AFAIK, shitty is similar to invoker, but does more : it install the current
artifact in local repo with version "testing" and invoke a maven build.
Seems to be what the invoker it-test do. Shitty alos use groovy scripts to
test the result.

Nico.


2007/12/13, Dan Fabulich <da...@fabulich.com>:
>
> nicolas de loof wrote:
>
> > shitty is a very simple way to it-test plugins.
>
> So I've heard...  But I've also heard good things about
> maven-invoker-plugin.  And I've said a lot of good things about
> maven-verifier tests.  Why use SHITTY and not one of the others?
>
> Or, let me phrase my question a different way.  I think we shouldn't keep
> using more and more different IT test plugins; we should narrow it down to
> just one or two different ways of doing these tests.
>
> Do you agree with that?  If so, do you think we should use shitty instead
> of maven-invoker-plugin?  As well as maven-invoker-plugin?  Should
> everybody just use whatever works?  (That's a fair answer, too...)
>
> -Dan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by Dan Fabulich <da...@fabulich.com>.
nicolas de loof wrote:

> shitty is a very simple way to it-test plugins.

So I've heard...  But I've also heard good things about 
maven-invoker-plugin.  And I've said a lot of good things about 
maven-verifier tests.  Why use SHITTY and not one of the others?

Or, let me phrase my question a different way.  I think we shouldn't keep 
using more and more different IT test plugins; we should narrow it down to 
just one or two different ways of doing these tests.

Do you agree with that?  If so, do you think we should use shitty instead 
of maven-invoker-plugin?  As well as maven-invoker-plugin?  Should 
everybody just use whatever works?  (That's a fair answer, too...)

-Dan

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


Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by nicolas de loof <ni...@apache.org>.
One repo test use testing-harness.

Other ones require to have many maven stubs, and a Project with an
ArtifactHandler (for language == java check) that is not (yet) supported bu
maven-plugin-testing-harness.

shitty is a very simple way to it-test plugins.

2007/12/13, Dan Fabulich <da...@fabulich.com>:
>
> nicolas de loof wrote:
>
> > I tried to look at maven-eclipse-plugin tests and was really confused on
> > it's testing framework complexity.
>
> Am I right in thinking that right now it's using the
> "maven-plugin-testing-harness?"  (I've never understood that either,
> though I haven't tried very hard.)
>
> > What about moving thoses IT tests to src/it via the Shitty maven plugin
> > ( http://mojo.codehaus.org/shitty-maven-plugin/usage.html) I allready
> > used it and found it simple to use and very powerfull.
>
> We've already got at least two other mechanisms for running plugin IT
> tests: maven-invoker-plugin and tests written in the maven-verifier style
> like those in maven/core-integration-testing or
> maven-surefire-plugin/trunk/surefire-integration-tests.  (I think the
> surefire tests might be a better example for comparison with the Eclipse
> plugin.)
>
>
> http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleTest.java
> http://tinyurl.com/3aqauu
>
> Can you help me understand the difference between SHITTY and those other
> mechanisms?  I'd really like to firmly advocate against proliferating more
> IT frameworks, that we try to narrow down on just one or two.
>
> In particular, I don't see advantages over using SHITTY versus using
> maven-invoker-plugin... I mean, I know they all do the same thing, but
> m-i-p and SHITTY look *really* similar.  Why use one over the other?
>
> Moreover, as you may have noticed in a nearby thread, jdcasey and I have
> been discussing the merits and flaws of the maven-invoker-plugin vs. the
> maven-verifier style of testing.  I think everything we've said about the
> m-i-p (for and against) would apply equally to SHITTY; I'm curious whether
> you have thoughts about this.
>
> > The only difficulty AFAIK is to refactor the generated file verification
> > to be used from validate.groovy scripts.
>
> I don't think this would be a difficulty if the tests were using the
> maven-verifier style; I think they may also be a bit more comprehensible
> that way, though I'll admit that I'm biased.
>
> -Dan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by Arnaud HERITIER <ah...@gmail.com>.
Personally, I found the  the shitty plugin easier to setup than others
plugin.
You just add it in your pom and it works. The counterpart is that there are
many less settings compared to others, but I thing that the ones added to
the shitty plugin are enough for a lot of plugins.
Another thing, why I choosed the shitty is due to the usage of groovy and
not beanshell for init/validation script.
I don't know really well groovy but I can write those script in java. In
beanshell, even if the langage seems to be powerful I didn't want to learn a
new one just to write integration tests.

Arnaud

On Dec 14, 2007 5:50 AM, Brian E. Fox <br...@reply.infinity.nu> wrote:

>
> >Am I right in thinking that right now it's using the
> >"maven-plugin-testing-harness?"  (I've never understood that either,
> >though I haven't tried very hard.)
>
> Yes. It actually works quite nicely. I'm having issues with not getting
> the error code on windows, but this is a plexus-cli issue and not
> directly related to invoker or the harness.
>
> The harness modifies the pom to change the rev to test. It then builds
> the plugin to a new local repo and then executes all the tests against
> that plugin and repo. The one issue I have with it now is that it isn't
> going to your real local to pull artifacts so it downloads from central
> everytime. This is slower than it should be and doesn't work
> offline...but that's an easy fix: configure the current local repo as a
> repote repo in the test builds.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>


-- 
..........................................................
Arnaud HERITIER
..........................................................
OCTO Technology - aheritier AT octo DOT com
www.octo.com | blog.octo.com
..........................................................
ASF - aheritier AT apache DOT org
www.apache.org | maven.apache.org
...........................................................

RE: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
>Am I right in thinking that right now it's using the 
>"maven-plugin-testing-harness?"  (I've never understood that either, 
>though I haven't tried very hard.)

Yes. It actually works quite nicely. I'm having issues with not getting
the error code on windows, but this is a plexus-cli issue and not
directly related to invoker or the harness.

The harness modifies the pom to change the rev to test. It then builds
the plugin to a new local repo and then executes all the tests against
that plugin and repo. The one issue I have with it now is that it isn't
going to your real local to pull artifacts so it downloads from central
everytime. This is slower than it should be and doesn't work
offline...but that's an easy fix: configure the current local repo as a
repote repo in the test builds.

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


Re: [MECLIPSE] refactor IT tests to use shitty maven plugin ?

Posted by Dan Fabulich <da...@fabulich.com>.
nicolas de loof wrote:

> I tried to look at maven-eclipse-plugin tests and was really confused on
> it's testing framework complexity.

Am I right in thinking that right now it's using the 
"maven-plugin-testing-harness?"  (I've never understood that either, 
though I haven't tried very hard.)

> What about moving thoses IT tests to src/it via the Shitty maven plugin 
> ( http://mojo.codehaus.org/shitty-maven-plugin/usage.html) I allready 
> used it and found it simple to use and very powerfull.

We've already got at least two other mechanisms for running plugin IT 
tests: maven-invoker-plugin and tests written in the maven-verifier style 
like those in maven/core-integration-testing or 
maven-surefire-plugin/trunk/surefire-integration-tests.  (I think the 
surefire tests might be a better example for comparison with the Eclipse 
plugin.)

http://svn.apache.org/repos/asf/maven/surefire/trunk/surefire-integration-tests/src/test/java/org/apache/maven/surefire/its/TestSingleTest.java
http://tinyurl.com/3aqauu

Can you help me understand the difference between SHITTY and those other 
mechanisms?  I'd really like to firmly advocate against proliferating more 
IT frameworks, that we try to narrow down on just one or two.

In particular, I don't see advantages over using SHITTY versus using 
maven-invoker-plugin... I mean, I know they all do the same thing, but 
m-i-p and SHITTY look *really* similar.  Why use one over the other?

Moreover, as you may have noticed in a nearby thread, jdcasey and I have 
been discussing the merits and flaws of the maven-invoker-plugin vs. the 
maven-verifier style of testing.  I think everything we've said about the 
m-i-p (for and against) would apply equally to SHITTY; I'm curious whether 
you have thoughts about this.

> The only difficulty AFAIK is to refactor the generated file verification 
> to be used from validate.groovy scripts.

I don't think this would be a difficulty if the tests were using the 
maven-verifier style; I think they may also be a bit more comprehensible 
that way, though I'll admit that I'm biased.

-Dan

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