Integration/Acceptance testing with already installed/deployed artifacts

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Integration/Acceptance testing with already installed/deployed artifacts

hajush

How can you run integration or acceptance tests separately from the compile and package lifecycle phases using maven? In other words - given that all my artifacts have already been generated and are available in my local maven cache (from a prior run of mvn install) or in the remote repository after a deploy - is it possible to run something like "mvn verify" or even "mvn failsafe:verify" but WITHOUT running the earlier lifecycle phases again? We want to test on other platforms using the prior generated artifacts. It would be ok to recompile the test classes again, but not the artifact sources.

There are a few pages up already about how to write integration tests - and a few solutions and a few JIRA issues filed, but I've not found anything that explicitly looks at the desire to avoid doing the compilation and packaging again - and only to rely on currently installed or deployed artifacts for testing.

SUREFIRE-142
maven-failsafe-plugin
Maven and Integration Testing
Reply | Threaded
Open this post in threaded view
|

Re: Integration/Acceptance testing with already installed/deployed artifacts

Ron Wheeler
shinsato wrote:

> How can you run integration or acceptance tests separately from the compile
> and package lifecycle phases using maven? In other words - given that all my
> artifacts have already been generated and are available in my local maven
> cache (from a prior run of mvn install) or in the remote repository after a
> deploy - is it possible to run something like "mvn verify" or even "mvn
> failsafe:verify" but WITHOUT running the earlier lifecycle phases again? We
> want to test on other platforms using the prior generated artifacts. It
> would be ok to recompile the test classes again, but not the artifact
> sources.
>
>
> There are a few pages up already about how to write integration tests - and
> a few solutions and a few JIRA issues filed, but I've not found anything
> that explicitly looks at the desire to avoid doing the compilation and
> packaging again - and only to rely on currently installed or deployed
> artifacts for testing.
>
>
> http://jira.codehaus.org/browse/SUREFIRE-142 SUREFIRE-142
>
>
> http://maven.apache.org/plugins/maven-failsafe-plugin/usage.html
> maven-failsafe-plugin
>
>
> http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
> Maven and Integration Testing
>  
One simple way would be to create a test project (or set of test
projects) that has your libraries as dependencies so that they are
pulled in from your repository as a compiled jar.

You may have a few artifacts that can not be put into dependent
libraries but that should be a small compile step with only a few classes.

Ron


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Integration/Acceptance testing with already installed/deployed artifacts

jieryn
In reply to this post by hajush
Hi Harold,

On Thu, Apr 1, 2010 at 1:53 PM, shinsato <[hidden email]> wrote:
>
> How can you run integration or acceptance tests separately from the compile
> and package lifecycle phases using maven?

You could always create a separate test-oriented module, which depends
on the code you want to test, and just run your tests through it.
There's no way in Maven to guarantee that you're testing against the
exact artifact produced from another module unless it is within the
same reactor. Hudson fingerprinting kind of gets you there but.....

-Jesse

--
There are 10 types of people in this world, those
that can read binary and those that can not.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Integration/Acceptance testing with already installed/deployed artifacts

hajush
In reply to this post by Ron Wheeler
Thanks, Ron - Jesse- our integration tests are mostly in separate modules - though there is some internal pressure to keep the test code closer to the source code - this is probably a clincher argument to put them in separate modules. I've tended to have bad experiences running child projects separately from their place in the reactor - but I can experiment and see how it goes.

ronatartifact wrote
shinsato wrote:
> How can you run integration or acceptance tests separately from the compile
> and package lifecycle phases using maven? In other words - given that all my
> artifacts have already been generated and are available in my local maven
> cache (from a prior run of mvn install) or in the remote repository after a
> deploy - is it possible to run something like "mvn verify" or even "mvn
> failsafe:verify" but WITHOUT running the earlier lifecycle phases again? We
> want to test on other platforms using the prior generated artifacts. It
> would be ok to recompile the test classes again, but not the artifact
> sources.
>
>
> There are a few pages up already about how to write integration tests - and
> a few solutions and a few JIRA issues filed, but I've not found anything
> that explicitly looks at the desire to avoid doing the compilation and
> packaging again - and only to rely on currently installed or deployed
> artifacts for testing.
>
>
> http://jira.codehaus.org/browse/SUREFIRE-142 SUREFIRE-142
>
>
> http://maven.apache.org/plugins/maven-failsafe-plugin/usage.html
> maven-failsafe-plugin
>
>
> http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
> Maven and Integration Testing
>  
One simple way would be to create a test project (or set of test
projects) that has your libraries as dependencies so that they are
pulled in from your repository as a compiled jar.

You may have a few artifacts that can not be put into dependent
libraries but that should be a small compile step with only a few classes.

Ron


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Reply | Threaded
Open this post in threaded view
|

Re: Integration/Acceptance testing with already installed/deployed artifacts

Ron Wheeler
shinsato wrote:
> Thanks, Ron - Jesse- our integration tests are mostly in separate modules -
> though there is some internal pressure to keep the test code closer to the
> source code - this is probably a clincher argument to put them in separate
> modules. I've tended to have bad experiences running child projects
> separately from their place in the reactor - but I can experiment and see
> how it goes.
>  
It is a bit hard to know what to suggest with so little insight into the
project.
I can only speak from my own experience where we started with big
projects with many source files in the projects and are now trying to
get them broken down into small projects that produce WAR files using
libraries that are built, and, I hope tested, separately. We are pulling
classes from the big projects into their own smaller projects that just
make jar files for inclusion into the WAR file projects as dependencies.
It is not really refactoring the code, just moving the sources into new
projects, making new POM files and adding dependencies to the old POMS.
Not  big programming job, just a bit of thoughtful shuffling

Ron

>
> ronatartifact wrote:
>  
>> shinsato wrote:
>>    
>>> How can you run integration or acceptance tests separately from the
>>> compile
>>> and package lifecycle phases using maven? In other words - given that all
>>> my
>>> artifacts have already been generated and are available in my local maven
>>> cache (from a prior run of mvn install) or in the remote repository after
>>> a
>>> deploy - is it possible to run something like "mvn verify" or even "mvn
>>> failsafe:verify" but WITHOUT running the earlier lifecycle phases again?
>>> We
>>> want to test on other platforms using the prior generated artifacts. It
>>> would be ok to recompile the test classes again, but not the artifact
>>> sources.
>>>
>>>
>>> There are a few pages up already about how to write integration tests -
>>> and
>>> a few solutions and a few JIRA issues filed, but I've not found anything
>>> that explicitly looks at the desire to avoid doing the compilation and
>>> packaging again - and only to rely on currently installed or deployed
>>> artifacts for testing.
>>>
>>>
>>> http://jira.codehaus.org/browse/SUREFIRE-142 SUREFIRE-142
>>>
>>>
>>> http://maven.apache.org/plugins/maven-failsafe-plugin/usage.html
>>> maven-failsafe-plugin
>>>
>>>
>>> http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing
>>> Maven and Integration Testing
>>>  
>>>      
>> One simple way would be to create a test project (or set of test
>> projects) that has your libraries as dependencies so that they are
>> pulled in from your repository as a compiled jar.
>>
>> You may have a few artifacts that can not be put into dependent
>> libraries but that should be a small compile step with only a few classes.
>>
>> Ron
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>>    
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]