You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Yi Liang (JIRA)" <ji...@apache.org> on 2017/02/02 00:21:51 UTC

[jira] [Comment Edited] (HBASE-17574) Clean up how to run tests under hbase-spark module

    [ https://issues.apache.org/jira/browse/HBASE-17574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15847673#comment-15847673 ] 

Yi Liang edited comment on HBASE-17574 at 2/2/17 12:21 AM:
-----------------------------------------------------------

Since Java and Scala has different maven plugin to run test case, java use surefire and scala use scalatest, those two plugins are different at some point, so what I can do is to provide a patch which have following usage that followed current rules

under hbase-spark dir or root dir
1. mvn test    //run all small and medium java tests, and all scala tests
2. mvn test -pSkipSparkTests  //skip all scale and java test in hbase-spark
3. mvn test -P runAllTests    //run all tests, including scala and java test cases
4. mvn test -P runMediumTests  //run all medium java test and all scala test, the similar command like Small,Large are only apply to java test cases

//run specified test case,  since we have two plugins, we need specify both java and scala 
//if just want to test one, we need to disable the other one use -Dxx=None
1. mvn test -Dtest=TestJavaHBaseContext -DwildcardSuites=None  // java unit test
2. mvn test -Dtest=None -DwildcardSuites=org.apache.hadoop.hbase.spark.BulkLoadSuite //scala unit test, only support full name in scaliest
3. mvn test -Dtest=TestJavaHBaseContext -DwildcardSuites=org.apache.hadoop.hbase.spark.BulkLoadSuite//run specified java and scale unit test



was (Author: easyliangjob):
Since Java and Scala has different maven plugin to run test case, java use surefire and scala use scalatest, those two plugins are different at some point, so what I can do is to provide a patch which have following usage

under hbase-spark dir or root dir 
1. mvn test:  run all the small java test, and all scala test(Still do not know whether we can catogory scala test into small, medium, and large, if they can be categorized, then this command can only apply to small test in scala)

2. mvn test -Dtest=TestJavaHBaseContext  -DwildcardSuites=None(only run specified java unit test)

3. mvn test -Dtest=None  -DwildcardSuites=org.apache.hadoop.hbase.spark.BulkLoadSuite (only run specified scala unit test,  scalatest plugin only support full class name)

Under root dir 
1. mvn test -DskipSparkTests   //skip all the hbase-spark tests

this jira is only for unit test, and if possible, I can open another jira to try to add integration test case of hbase-spark into hbase-it module

> Clean up how to run tests under hbase-spark module 
> ---------------------------------------------------
>
>                 Key: HBASE-17574
>                 URL: https://issues.apache.org/jira/browse/HBASE-17574
>             Project: HBase
>          Issue Type: Bug
>          Components: spark
>    Affects Versions: 2.0.0
>            Reporter: Yi Liang
>            Assignee: Yi Liang
>             Fix For: 2.0.0
>
>
> In master brunch, the test of hbase-spark module needs clean-up.
> I think we need to let hbase-spark follow the rules that exist in the whole hbase project
> 1. In hbase-spark, all the scala test cases are regarded as integration test, i.e. we need to go to hbase-spark folder to use mvn verify to run the test case.  I think these tests had better to be regard as unit test for the following reasons:
> (1) All the scala test are very small, most of them can be finished within 20s.
> (2) Integration test usually  put into hbase-it module, not in its own module.
> (3) Hadoop QA could not run those scala test in hbase-spark, I guess Hadoop QA will only run mvn test under root dir, however hbase-spark need mvn verify.
> (4) From its pom.xml below, you can see that, both <phase>integration-test</phase> and <phase>test</phase> point to same <goal>test</goal>. From MVN reference, http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Built-in_Lifecycle_Bindings, we know that if a goal is bound to one or more build phases, that goal will be called in all those phases. it means that mvn test and mvn integration-test will do same thing, however <skipTests>true</skipTests> in test phase just disable the mvn test command.  It is uncommon to have define like that. 
> {code}
>                   <executions>
>                     <execution>
>                         <id>test</id>
>                         <phase>test</phase>
>                         <goals>
>                             <goal>test</goal>
>                         </goals>
>                         <configuration>
>                             <skipTests>true</skipTests>
>                         </configuration>
>                     </execution>
>                     <execution>
>                         <id>integration-test</id>
>                         <phase>integration-test</phase>
>                         <goals>
>                             <goal>test</goal>
>                         </goals>
>                         <configuration>
>                             <tagsToExclude>Integration-Test</tagsToExclude>
>                             <argLine>
>                                 -Xmx1536m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=512m
>                             </argLine>
>                             <parallel>false</parallel>
>                         </configuration>
>                     </execution>
>                 </executions>
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)