You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Grzegorz SÅ‚owikowski <gs...@op.pl> on 2006/01/12 12:46:27 UTC

Integration tests

Hi all

We have a lot of problems with our integration tests, and I would like
to share out thoughts with you. I saw voting for Maven 2.0.2 has started,
so this is last minute to change something before 2.0.2.

1. I think that the two new phases: before/after-integration-test should
be renamed to pre/post-integration-test. The prefixes would be similar
to pre/post-site and pre/post-clean. What do you think?

2. We cannot compile our intergation tests sources with maven-compiler-plugin
because we cannot change compileSourceRoots. Firstly it is readonly, and
secondly there is no way to set them in configuration in pom file.
We had to write our own it compiler plugin by copying almost all sources
from TestCompilerMojo.java.
What would be the best solution? Changing one of the standard compiler mojos?
Adding additional generic mojo without "readonly"'s, with possibility to set
source roots, etc? Maybe something else. I don't like what we had to do - 
copy/paste a lot of source from one of maven-compiler-plugin mojos.

Pablo from my team wrote about it today, and Bob Allison here:
 http://jira.codehaus.org/browse/MCOMPILER-13.

3. Now all our artifacts for integration testing (there are lot of them) have "test"
scope. So they are included in unit testing classpaths too. Would it be ok
to add another scope - "it" to separate it artifacts from unit testing artifacts?

4. ... more later ...


Greg

Re: Integration tests

Posted by Brett Porter <br...@apache.org>.
It looks like integration testing will need to be done in a profile.
IMO, that's really not such a bad thing. In fact, it could be fairly clean.

If there is additional integration testing support to come, then it will
have to wait until Maven 2.1. This may mean we bring forward the
deadline for 2.1 and make it a smaller feature release focusing on some
key objectives - things that are currently impossible or very difficult
to use. That is likely a good idea anyway.

- Brett

Pablo wrote:
>  Brett Porter wrote:
> 
>>> What would be the best solution? Changing one of the standard
>>> compiler mojos?
>>> Adding additional generic mojo without "readonly"'s, with possibility
>>> to set
>>> source roots, etc? Maybe something else. I don't like what we had to
>>> do - copy/paste a lot of source from one of maven-compiler-plugin mojos.
>>>
>>> Pablo from my team wrote about it today, and Bob Allison here:
>>> http://jira.codehaus.org/browse/MCOMPILER-13.
>>>   
>>
>> I thought this was too much of a coincidence :)
>>
>> Use the build-helper-maven plugin from org.codehaus.mojo.
>>  
>>
>> From 
> http://mojo.codehaus.org/build-helper-maven-plugin/add-source-mojo.html:
> 
> |sources| /(Optional)/     |File|     |-|     |-|     Additional source
> directories
> 
> 
> I've never used this plugin but what I understand of it is that this
> plugin adds additional directory.
> *Add a source directory* to POM (from plugin's site).
> Therefore a directory set in Mojo as a default one is also included.
> In that case target/integration-tests would also include unit test
> classes from target/test-classes (compiled sources from src/tests)..
> Am I right? If so, it's not a solution.
> 
> Cheers
> Pablo
> 

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


Re: Integration tests

Posted by Pablo <pa...@tiger.com.pl>.
  Brett Porter wrote:

>>What would be the best solution? Changing one of the standard compiler mojos?
>>Adding additional generic mojo without "readonly"'s, with possibility to set
>>source roots, etc? Maybe something else. I don't like what we had to do - 
>>copy/paste a lot of source from one of maven-compiler-plugin mojos.
>>
>>Pablo from my team wrote about it today, and Bob Allison here:
>> http://jira.codehaus.org/browse/MCOMPILER-13.
>>    
>>
>
>I thought this was too much of a coincidence :)
>
>Use the build-helper-maven plugin from org.codehaus.mojo.
>  
>
>From 
http://mojo.codehaus.org/build-helper-maven-plugin/add-source-mojo.html:

|sources| /(Optional)/ 	|File| 	|-| 	|-| 	Additional source directories


I've never used this plugin but what I understand of it is that this 
plugin adds additional directory.
*Add a source directory* to POM (from plugin's site).
Therefore a directory set in Mojo as a default one is also included.
In that case target/integration-tests would also include unit test 
classes from target/test-classes (compiled sources from src/tests)..
Am I right? If so, it's not a solution.

Cheers
Pablo

Re: Integration tests

Posted by Brett Porter <br...@apache.org>.
Grzegorz SÅ‚owikowski wrote:
> Hi all
> 
> We have a lot of problems with our integration tests, and I would like
> to share out thoughts with you. I saw voting for Maven 2.0.2 has started,
> so this is last minute to change something before 2.0.2.
> 
> 1. I think that the two new phases: before/after-integration-test should
> be renamed to pre/post-integration-test. The prefixes would be similar
> to pre/post-site and pre/post-clean. What do you think?

This is a good point. Since they were only introduced after 2.0.1, we
should rename them.

> 
> 2. We cannot compile our intergation tests sources with maven-compiler-plugin
> because we cannot change compileSourceRoots. Firstly it is readonly, and
> secondly there is no way to set them in configuration in pom file.
> We had to write our own it compiler plugin by copying almost all sources
> from TestCompilerMojo.java.
> What would be the best solution? Changing one of the standard compiler mojos?
> Adding additional generic mojo without "readonly"'s, with possibility to set
> source roots, etc? Maybe something else. I don't like what we had to do - 
> copy/paste a lot of source from one of maven-compiler-plugin mojos.
> 
> Pablo from my team wrote about it today, and Bob Allison here:
>  http://jira.codehaus.org/browse/MCOMPILER-13.

I thought this was too much of a coincidence :)

Use the build-helper-maven plugin from org.codehaus.mojo.

> 3. Now all our artifacts for integration testing (there are lot of them) have "test"
> scope. So they are included in unit testing classpaths too. Would it be ok
> to add another scope - "it" to separate it artifacts from unit testing artifacts?

Not for 2.0.2. We can discuss along with the numerous i-t topics.

- Brett

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