Steven Rowe created LUCENE-4045:
-----------------------------------

             Summary: Switch Maven test runner from maven-surefire-plugin to 
com.carrotsearch.randomizedtesting:junit4-maven-plugin
                 Key: LUCENE-4045
                 URL: https://issues.apache.org/jira/browse/LUCENE-4045
             Project: Lucene - Java
          Issue Type: Improvement
          Components: general/test
    Affects Versions: 4.0
            Reporter: Steven Rowe
            Priority: Minor


{{com.carrotsearch.randomizedtesting:junit4-maven-plugin}} can be used to run 
all Lucene/Solr tests under Maven, providing faster execution through load 
balancing, along with all the other goodies CS.RT brings.  (Not to mention it 
would make testing under Maven much more like testing under Ant.)

>From [a post Dawid Weiss made on the maven-dev mailing list in 
>January|http://mail-archives.apache.org/mod_mbox/maven-dev/201201.mbox/%3ccam21rt8kdxowwmy3uq+fqvn979fq3mbm_gveqwoh226mh_z...@mail.gmail.com%3E]:
{quote}
http://labs.carrotsearch.com/randomizedtesting.html
[...]
Load balancing is just part of what the project is about [...]

Maven integration can be seen as an integration test (with scarce documentation 
yet) here:
https://github.com/carrotsearch/randomizedtesting/blob/master/integration-maven/junit4-maven-plugin-tests/src/it/01-basic-test/pom.xml

I've used it in another project, so a cleaner example of use from within a POM 
is here (you should disable surefire or your tests will run twice):

https://github.com/carrotsearch/hppc/blob/master/hppc-core/pom.xml#L217
{quote}

And from [a post Dawid made to the lucene-dev mailing list in 
April|http://mail-archives.apache.org/mod_mbox/lucene-dev/201204.mbox/%3CCAM21Rt-Rc_Z6X04fznvsbK-d8APiUuYCMC-kvg7i=hzthaq...@mail.gmail.com%3E]:

{quote}
I didn't mention it but there is actually an equivalent of <junit4> task as a 
maven plugin... it basically redirects to the ant-plugin but has a maven-like 
facade for passing the basic set of properties. I don't think it makes such a 
big difference for maven build - we can stick to surefire. Let me know if you'd 
like to try that other plugin though -- an example of a maven pom using it is 
here:

https://github.com/carrotsearch/randomizedtesting/blob/master/examples/maven/pom.xml
{quote}

The CS.RT maven plugin requires Maven v3.0.2+; I asked Dawid whether Maven 
2.2.1 could be supported, and in private emails to me, he replied:
{quote}
I looked at it but it seems I need to stick to Maven 3 -- there are APIs for 
filtering artefacts that seem to be available in 3.x only (copied and pasted 
from surefire and maven core). If you want to dig the code is on github, I 
won't have the time to look into it in the near future (first short vacation, 
then a backlog of crap to deal with).
{quote}
{quote}
I admit I don't have enough Maven powers to actually think of a way to use 
either surefire or another plugin (depending on a sysproperty or something). 
This could be a fallback for folks who really need maven 2.x.
{quote}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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

Reply via email to