HBASE-6087 Add hbase-common module: ADDENDUM
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1344558 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b3ec7ced77
commit
3216974717
|
@ -67,6 +67,19 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
<!-- Skip the tests in this module -->
|
||||||
|
<profile>
|
||||||
|
<id>skip-common-tests</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>skip-common-tests</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<surefire.skipFirstPart>true</surefire.skipFirstPart>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
<!-- profile against Hadoop 1.0.x: This is the default. It has to have the same
|
<!-- profile against Hadoop 1.0.x: This is the default. It has to have the same
|
||||||
activation property as the parent Hadoop 1.0.x profile to make sure it gets run at
|
activation property as the parent Hadoop 1.0.x profile to make sure it gets run at
|
||||||
the same time. -->
|
the same time. -->
|
||||||
|
|
|
@ -465,6 +465,20 @@
|
||||||
|
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|
||||||
|
<!-- Skip the tests in this module -->
|
||||||
|
<profile>
|
||||||
|
<id>skip-server-tests</id>
|
||||||
|
<activation>
|
||||||
|
<property>
|
||||||
|
<name>skip-server-tests</name>
|
||||||
|
</property>
|
||||||
|
</activation>
|
||||||
|
<properties>
|
||||||
|
<surefire.skipFirstPart>true</surefire.skipFirstPart>
|
||||||
|
<surefire.skipSecondPart>true</surefire.skipSecondPart>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
|
||||||
<!-- Special builds -->
|
<!-- Special builds -->
|
||||||
<profile>
|
<profile>
|
||||||
<id>hadoop-snappy</id>
|
<id>hadoop-snappy</id>
|
||||||
|
|
|
@ -18,7 +18,7 @@ package org.apache.hadoop.hbase.util;
|
||||||
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
|
||||||
import org.apache.hadoop.hbase.HConstants;
|
import org.apache.hadoop.hbase.master.HMaster;
|
||||||
|
|
||||||
/** Determines HBase home path from either class or jar directory */
|
/** Determines HBase home path from either class or jar directory */
|
||||||
public class HBaseHomePath {
|
public class HBaseHomePath {
|
||||||
|
@ -31,7 +31,7 @@ public class HBaseHomePath {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getHomePath() {
|
public static String getHomePath() {
|
||||||
String className = HConstants.class.getName(); // This could have been any HBase class.
|
String className = HMaster.class.getName(); // This could have been any HBase class.
|
||||||
String relPathForClass = className.replace(".", "/") + ".class";
|
String relPathForClass = className.replace(".", "/") + ".class";
|
||||||
URL url = ClassLoader.getSystemResource(relPathForClass);
|
URL url = ClassLoader.getSystemResource(relPathForClass);
|
||||||
relPathForClass = "/" + relPathForClass;
|
relPathForClass = "/" + relPathForClass;
|
||||||
|
|
|
@ -276,18 +276,37 @@ What is the new development version for "HBase"? (org.apache.hbase:hbase) 0.92.1
|
||||||
<section xml:id="hbase.tests">
|
<section xml:id="hbase.tests">
|
||||||
<title>Tests</title>
|
<title>Tests</title>
|
||||||
|
|
||||||
<para>HBase tests are divided into two groups: <xref linkend="hbase.unittests"/> and
|
<para> Developers, at a minimum, should familiarize themselves with the unit test detail; unit tests in
|
||||||
<xref linkend="integration.tests" /> (As of this writing, Integration tests are little
|
|
||||||
developed).
|
|
||||||
Unit tests are run by the Apache Continuous Integration server, Jenkins at
|
|
||||||
builds.apache.org, and by developers when they are verifying a fix does not cause breakage elsewhere in the code base.
|
|
||||||
Integration tests are generally long-running tests that are invoked out-of-bound of
|
|
||||||
the CI server when you want to do more intensive testing beyond the unit test set.
|
|
||||||
Integration tests, for example, are run proving a release candidate or a production
|
|
||||||
deploy. Below we go into more detail on each of these test types. Developers at a
|
|
||||||
minimum should familiarize themselves with the unit test detail; unit tests in
|
|
||||||
HBase have a character not usually seen in other projects.</para>
|
HBase have a character not usually seen in other projects.</para>
|
||||||
|
|
||||||
|
<section xml:id="hbase.moduletests">
|
||||||
|
<title>HBase Modules</title>
|
||||||
|
<para>As of 0.96, HBase is split into multiple modules which creates "interesting" rules for
|
||||||
|
how and where tests are written. If you are writting code for <classname>hbase-server</classname>, see
|
||||||
|
<xref linkend="hbase.unittests"/> for how to write your tests; these tests can spin
|
||||||
|
up a minicluster and will need to be categorized. For any other module, for example
|
||||||
|
<classname>hbase-common</classname>, the tests must be strict unit tests and just test the class
|
||||||
|
under test - no use of the HBaseTestingUtility or minicluster is allowed (or even possible
|
||||||
|
given the dependency tree).</para>
|
||||||
|
<section xml:id="hbase.moduletest.run">
|
||||||
|
<title>Running Tests in other Modules</title>
|
||||||
|
If the module you are developing in has no other dependencies on other HBase modules, then
|
||||||
|
you can cd into that module and just run:
|
||||||
|
<programlisting>mvn test</programlisting>
|
||||||
|
which will just run the tests IN THAT MODULE. If there are other dependencies on other modules,
|
||||||
|
then you will have run the command from the ROOT HBASE DIRECTORY. This will run the tests in the other
|
||||||
|
modules, unless you specify to skip the tests in that module. For instance, to skip the tests in the hbase-server module,
|
||||||
|
you would run:
|
||||||
|
<programlisting>mvn clean test -Dskip-server-tests</programlisting>
|
||||||
|
from the top level directory to run all the tests in modules other than hbase-server. Note that you
|
||||||
|
can specify to skip tests in multiple modules as well as just for a single module. For example, to skip
|
||||||
|
the tests in <classname>hbase-server</classname> and <classname>hbase-common</classname>, you would run:
|
||||||
|
<programlisting>mvn clean test -Dskip-server-tests -Dskip-common-tests</programlisting>
|
||||||
|
<para>Also, keep in mind that if you are running tests in the <classname>hbase-server</classname> module you will need to
|
||||||
|
apply the maven profiles discussed in <xref linkend="hbase.unittests.cmds"/> to get the tests to run properly.</para>
|
||||||
|
</section>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section xml:id="hbase.unittests">
|
<section xml:id="hbase.unittests">
|
||||||
<title>Unit Tests</title>
|
<title>Unit Tests</title>
|
||||||
<para>HBase unit tests are subdivided into three categories: small, medium and large, with
|
<para>HBase unit tests are subdivided into three categories: small, medium and large, with
|
||||||
|
@ -333,8 +352,7 @@ individually. They can use a cluster, and each of them is executed in a separate
|
||||||
<section xml:id="hbase.unittests.large">
|
<section xml:id="hbase.unittests.large">
|
||||||
<title><indexterm><primary>LargeTests</primary></indexterm></title>
|
<title><indexterm><primary>LargeTests</primary></indexterm></title>
|
||||||
<para><emphasis>Large</emphasis> tests are everything else. They are typically integration-like
|
<para><emphasis>Large</emphasis> tests are everything else. They are typically integration-like
|
||||||
tests (yes, some large tests should be moved out to be HBase <xref linkend="integration.tests" />),
|
tests, regression tests for specific bugs, timeout tests, performance tests.
|
||||||
regression tests for specific bugs, timeout tests, performance tests.
|
|
||||||
They are executed before a commit on the pre-integration machines. They can be run on
|
They are executed before a commit on the pre-integration machines. They can be run on
|
||||||
the developer machine as well.
|
the developer machine as well.
|
||||||
</para>
|
</para>
|
||||||
|
@ -491,12 +509,6 @@ mvn compile
|
||||||
above in <xref linkend="hbase.unittests" /></para>
|
above in <xref linkend="hbase.unittests" /></para>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section xml:id="maven.build.commanas.integration.tests">
|
|
||||||
<title>Running all or individual Integration Tests</title>
|
|
||||||
<para>See <xref linkend="integration.tests" />
|
|
||||||
</para>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section xml:id="maven.build.hadoop">
|
<section xml:id="maven.build.hadoop">
|
||||||
<title>Building against various hadoop versions.</title>
|
<title>Building against various hadoop versions.</title>
|
||||||
<para>As of 0.96, HBase supports building against hadoop versions: 1.0.3, 2.0.0-alpha and 3.0.0-SNAPSHOT.
|
<para>As of 0.96, HBase supports building against hadoop versions: 1.0.3, 2.0.0-alpha and 3.0.0-SNAPSHOT.
|
||||||
|
|
1
pom.xml
1
pom.xml
|
@ -426,6 +426,7 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<!-- Generic testing configuration for all packages -->
|
<!-- Generic testing configuration for all packages -->
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<failIfNoTests>false</failIfNoTests>
|
||||||
<skip>${surefire.skipFirstPart}</skip>
|
<skip>${surefire.skipFirstPart}</skip>
|
||||||
<forkMode>${surefire.firstPartForkMode}</forkMode>
|
<forkMode>${surefire.firstPartForkMode}</forkMode>
|
||||||
<parallel>${surefire.firstPartParallel}</parallel>
|
<parallel>${surefire.firstPartParallel}</parallel>
|
||||||
|
|
Loading…
Reference in New Issue