Comments inline.

On Wed, Jul 06, 2005 at 09:54:55AM +0200, Vincent Massol wrote:
> Maven devs, 
> 
> Any idea about this below? I'd like to start committing the Clover plugin
> tomorrow but we need to decide about the directory structure before I do
> that.
> 
> Thanks
> -Vincent
> 
> > -----Original Message-----
> > From: Vincent Massol [mailto:[EMAIL PROTECTED]
> > Sent: lundi 4 juillet 2005 09:07
> > To: 'Maven Developers List'
> > Subject: Mixed plugins and functional tests for plugins? (was RE: [m2]
> > Clvoer plugin location (was RE: [m2] Forking a customlifecycle in a report
> > plugin?))
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: Jason van Zyl [mailto:[EMAIL PROTECTED]
> > > Sent: dimanche 3 juillet 2005 19:11
> > > To: Maven Developers List
> > > Subject: RE: [m2] Clvoer plugin location (was RE: [m2] Forking a
> > > customlifecycle in a report plugin?)
> > 
> > [snip]
> > 
> > > Vincent, we don't really have a sandbox area setup so I think everyone
> > > would agree that you having access to:
> > >
> > > http://svn.apache.org/viewcvs.cgi/maven/components/trunk/maven-plugins/
> > >
> > > Is just fine so you're setup there.
> > >
> > > Sorry for the delay, just got back from JavaOne.
> > 
> > Thanks. I'll commit what I have of the clover plugin later this week.
> > 
> > Before doing that I have 2 questions:
> > 
> > 1/ The Clover plugin is a mix of "standard" mojos and report mojos. Where
> > should it live? It seems you've made a distinction between report plugins
> > and other plugins. I believe that most plugin are actually a mix. For
> > example the checkstyle plugin should have a mojo for failing the build in
> > case of violation.

+1 for mixing these.

> > 2/ What directory structure do you want for functional tests for plugins?
> > Here's what I currently have:
> > 
> > maven-clover-plugin/
> >   |_ plugin/
> >   |_ samples/
> >     |_ simple/

This is the layout that makes most sense to me right now, but make sure to
name the directories like the artifacts they contain. Doing that will
yield this layout:

 maven-clover-plugin/
  |_ maven-clover-plugin/ <-- this is wierd
  |_ maven-clover-plugin-samples/
   |_ maven-clover-plugin-sample-simple/

Perhaps the root directory should be maven-clover? Would make more sense I
guess?

> > 
> > Where plugin/ is the directory of the plugin sources, samples/ the
> > directory where samples acting as functional tests are found and simple/
> > is one simple sample. There could be more than one in the future.
> > 
> > This does not fit the plugin structure I have seen so far because current
> > plugins do not have functional tests (most do not even have unit tests
> > actually).
> > 
> > I had discussed this with Trygve a bit on IRC and Trygve was suggesting
> > that I consider functional tests as unit tests and put them in
> > src/test/java. That would mean embedding Maven in the tests itself.

I still stand by that as a easy solution, another option is to have a
"functional-test" lifecycle that would execute after the existing "test"
lifecycle. The only benefit I see from this is that all unit tests would
be executed before the functional tests and that might save you some run
time.

> > I think there's some value in that but it's beyond my current knowledge to
> > do so. I do believe it would be nice to create a functional maven tester
> > plugin that would execute Maven projects located in directories specified
> > in a config element in the POM (say it would default to
> > src/test/projects). The plugin would embed an m2 instance and execute the
> > defined projects. This plugin would be bound to the functional-test phase.

Hey, seems like we have the same idea :)

> > This would allow us to have the following plugin source structure:
> > 
> > maven-clover-plugin/
> >   |_ src/
> >     |_ main/
> >     |_ test/
> >       |_ java/ <-- unit tests only
> >       |_ projects/
> >         |_ simple/
> > 
> > The plugin's POM would reference the maven tester plugin so that it is
> > bound to the functional-test phase and running "m2 install" would trigger
> > it.

I still think it would make more sense to make these functional tests
normal JUnit tests and instead of having a tester plugin just have a
simple tool for embedding Maven 2 because you still need to do assertions
after you've executed Maven.

How do you figure one should run the assertions with a tester plugin?

--
Trygve

Attachment: signature.asc
Description: Digital signature

Reply via email to