You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Ramakrishna S Vasudevan 00902313 <ra...@huawei.com> on 2011/10/06 19:13:18 UTC

Including specific tests in the latest pom.xml

Hi 

How should i add specific test case names that needs to be executed while running mvn tests.
In the latest pom.xml we have
<unittest.include>**/Test**.java</unittest.include>

Now if i try to add some 3 or 4 testcase name like stated below then only the last one in the list gets executed.
    <unittest.include>**/TestLogRolling*.java</unittest.include>
    <unittest.include>**/TestOpenRegionHandler*.java</unittest.include>
    <unittest.include>**/TestSplitTransaction*.java</unittest.include>

This is running only TestSplitTransaction.java

Previously             <include>**/TestHLog.java</include>
<include>**/TestMaster*.java</include>
It was running only TestHLog and all testcases starting with TestMaster.

Am i missing something here?  Any help is greatly appreciated.

Regards
Ram

Re: Including specific tests in the latest pom.xml

Posted by Gary Helmling <gh...@gmail.com>.
Ram,

If you just want to run a set of tests together, I think you can do that
from the command line:

mvn test -Dtest=TestLogRolling,TestOpenRegionHandler,TestSplitTransaction

Does that get you what you're after?

--gh


On Thu, Oct 6, 2011 at 11:08 AM, Ramakrishna S Vasudevan 00902313 <
ramakrishnas@huawei.com> wrote:

> Hi Jesse
> Thanks for your immediate response.  I could get what you are saying. But
> what i thought was few complex and important testcases i used to run as a
> set to see if they pass.  So i used to do like that in the earlier pom.xml.
>
> Any way to add only specified tests? May be am messing things around.
>
> Ideally here we use that way to exclude tests. :)
>
> Regards
> Ram
>
> ----- Original Message -----
> From: Jesse Yates <je...@gmail.com>
> Date: Thursday, October 6, 2011 11:30 pm
> Subject: Re: Including specific tests in the latest pom.xml
> To: "dev@hbase.apache.org" <de...@hbase.apache.org>
>
> > Why are you attempting to add them to the pom? If you just put them
> > in the right folder (src/test/java) and name them Test*.java (which
> > you already have) then they will run fine - no pom mods necessary.
> >
> > I think what you are doing just keeps overwriting the same maven
> > variable (unittests.include) so when it goes to run the tests, the
> > only pattern it knows to check is the bottom one.
> >
> > You really should only be messing with pons for unit tests when
> > there are tests that are failing that we want to exclude from the
> > build. This is a super super rare case, so in general you don't
> > need to worry about it.
> >
> > Does that help?
> >
> > - Jesse Yates
> >
> > Sent from my iPhone.
> >
> > On Oct 6, 2011, at 10:13 AM, Ramakrishna S Vasudevan 00902313
> > <ra...@huawei.com> wrote:
> >
> > > Hi
> > >
> > > How should i add specific test case names that needs to be
> > executed while running mvn tests.
> > > In the latest pom.xml we have
> > > <unittest.include>**/Test**.java</unittest.include>
> > >
> > > Now if i try to add some 3 or 4 testcase name like stated below
> > then only the last one in the list gets executed.
> > >    <unittest.include>**/TestLogRolling*.java</unittest.include>
> > >
> > <unittest.include>**/TestOpenRegionHandler*.java</unittest.include>>
>  <unittest.include>**/TestSplitTransaction*.java</unittest.include>
> > >
> > > This is running only TestSplitTransaction.java
> > >
> > > Previously             <include>**/TestHLog.java</include>
> > > <include>**/TestMaster*.java</include>
> > > It was running only TestHLog and all testcases starting with
> > TestMaster.>
> > > Am i missing something here?  Any help is greatly appreciated.
> > >
> > > Regards
> > > Ram
> >
>

Re: Including specific tests in the latest pom.xml

Posted by Ramakrishna S Vasudevan 00902313 <ra...@huawei.com>.
Hi Jesse
Thanks for your immediate response.  I could get what you are saying. But what i thought was few complex and important testcases i used to run as a set to see if they pass.  So i used to do like that in the earlier pom.xml. 

Any way to add only specified tests? May be am messing things around.

Ideally here we use that way to exclude tests. :)

Regards
Ram

----- Original Message -----
From: Jesse Yates <je...@gmail.com>
Date: Thursday, October 6, 2011 11:30 pm
Subject: Re: Including specific tests in the latest pom.xml
To: "dev@hbase.apache.org" <de...@hbase.apache.org>

> Why are you attempting to add them to the pom? If you just put them 
> in the right folder (src/test/java) and name them Test*.java (which 
> you already have) then they will run fine - no pom mods necessary.
> 
> I think what you are doing just keeps overwriting the same maven 
> variable (unittests.include) so when it goes to run the tests, the 
> only pattern it knows to check is the bottom one.
> 
> You really should only be messing with pons for unit tests when 
> there are tests that are failing that we want to exclude from the 
> build. This is a super super rare case, so in general you don't 
> need to worry about it. 
> 
> Does that help?
> 
> - Jesse Yates
> 
> Sent from my iPhone.
> 
> On Oct 6, 2011, at 10:13 AM, Ramakrishna S Vasudevan 00902313 
> <ra...@huawei.com> wrote:
> 
> > Hi 
> > 
> > How should i add specific test case names that needs to be 
> executed while running mvn tests.
> > In the latest pom.xml we have
> > <unittest.include>**/Test**.java</unittest.include>
> > 
> > Now if i try to add some 3 or 4 testcase name like stated below 
> then only the last one in the list gets executed.
> >    <unittest.include>**/TestLogRolling*.java</unittest.include>
> >    
> <unittest.include>**/TestOpenRegionHandler*.java</unittest.include>>    <unittest.include>**/TestSplitTransaction*.java</unittest.include>
> > 
> > This is running only TestSplitTransaction.java
> > 
> > Previously             <include>**/TestHLog.java</include>
> > <include>**/TestMaster*.java</include>
> > It was running only TestHLog and all testcases starting with 
> TestMaster.> 
> > Am i missing something here?  Any help is greatly appreciated.
> > 
> > Regards
> > Ram
> 

Re: Including specific tests in the latest pom.xml

Posted by Jesse Yates <je...@gmail.com>.
Why are you attempting to add them to the pom? If you just put them in the right folder (src/test/java) and name them Test*.java (which you already have) then they will run fine - no pom mods necessary.

I think what you are doing just keeps overwriting the same maven variable (unittests.include) so when it goes to run the tests, the only pattern it knows to check is the bottom one.

You really should only be messing with pons for unit tests when there are tests that are failing that we want to exclude from the build. This is a super super rare case, so in general you don't need to worry about it. 

Does that help?

- Jesse Yates

Sent from my iPhone.

On Oct 6, 2011, at 10:13 AM, Ramakrishna S Vasudevan 00902313 <ra...@huawei.com> wrote:

> Hi 
> 
> How should i add specific test case names that needs to be executed while running mvn tests.
> In the latest pom.xml we have
> <unittest.include>**/Test**.java</unittest.include>
> 
> Now if i try to add some 3 or 4 testcase name like stated below then only the last one in the list gets executed.
>    <unittest.include>**/TestLogRolling*.java</unittest.include>
>    <unittest.include>**/TestOpenRegionHandler*.java</unittest.include>
>    <unittest.include>**/TestSplitTransaction*.java</unittest.include>
> 
> This is running only TestSplitTransaction.java
> 
> Previously             <include>**/TestHLog.java</include>
> <include>**/TestMaster*.java</include>
> It was running only TestHLog and all testcases starting with TestMaster.
> 
> Am i missing something here?  Any help is greatly appreciated.
> 
> Regards
> Ram