You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ap...@apache.org on 2014/08/14 20:52:14 UTC

[1/3] git commit: HBASE-11731 Add option to only run a subset of the shell tests (Sean Busbey)

Repository: hbase
Updated Branches:
  refs/heads/0.98 3d292e8d7 -> eb175c2f1
  refs/heads/branch-1 a79e5ce52 -> fc5f0a672
  refs/heads/master 819b06d62 -> 865fae8a8


HBASE-11731 Add option to only run a subset of the shell tests (Sean Busbey)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/865fae8a
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/865fae8a
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/865fae8a

Branch: refs/heads/master
Commit: 865fae8a8056c1d3ffac32abe292017d3cc21155
Parents: 819b06d
Author: Andrew Purtell <ap...@apache.org>
Authored: Thu Aug 14 11:49:59 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Thu Aug 14 11:49:59 2014 -0700

----------------------------------------------------------------------
 hbase-shell/src/test/ruby/tests_runner.rb | 10 ++++++-
 src/main/docbkx/developer.xml             | 38 ++++++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/865fae8a/hbase-shell/src/test/ruby/tests_runner.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/tests_runner.rb b/hbase-shell/src/test/ruby/tests_runner.rb
index 7e40962..e1458db 100644
--- a/hbase-shell/src/test/ruby/tests_runner.rb
+++ b/hbase-shell/src/test/ruby/tests_runner.rb
@@ -54,7 +54,15 @@ files.each do |file|
   end
 end
 
-if !Test::Unit::AutoRunner.run
+# If this system property is set, we'll use it to filter the test cases.
+runner_args = []
+if java.lang.System.get_property('shell.test')
+  shell_test_pattern = java.lang.System.get_property('shell.test')
+  puts "Only running tests that match #{shell_test_pattern}"
+  runner_args << "--testcase=#{shell_test_pattern}"
+end
+# first couple of args are to match the defaults, so we can pass options to limit the tests run
+if !(Test::Unit::AutoRunner.run(false, nil, runner_args))
   raise "Shell unit tests failed. Check output file for details."
 end
 

http://git-wip-us.apache.org/repos/asf/hbase/blob/865fae8a/src/main/docbkx/developer.xml
----------------------------------------------------------------------
diff --git a/src/main/docbkx/developer.xml b/src/main/docbkx/developer.xml
index 91fb5f3..bf34a34 100644
--- a/src/main/docbkx/developer.xml
+++ b/src/main/docbkx/developer.xml
@@ -513,6 +513,44 @@ HBase have a character not usually seen in other projects.</para>
                 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.shell">
+    <title>Testing the HBase Shell</title>
+    <para>
+      The HBase shell and its tests are predominantly written in jruby. In order to make these
+      tests run as a part of the standard build, there is a single JUnit test,
+      <classname>TestShell</classname>, that takes care of loading the jruby implemented tests and
+      running them. You can run all of these tests from the top level with:
+    </para>
+    <programlisting language="bourne">
+      mvn clean test -Dtest=TestShell
+    </programlisting>
+    <para>
+      Alternatively, you may limit the shell tests that run using the system variable
+      <classname>shell.test</classname>. This value may specify a particular test case by name. For
+      example, the tests that cover the shell commands for altering tables are contained in the test
+      case <classname>AdminAlterTableTest</classname> and you can run them with:
+    </para>
+    <programlisting language="bourne">
+      mvn clean test -Dtest=TestShell -Dshell.test=AdminAlterTableTest
+    </programlisting>
+    <para>
+      You may also use a <link xlink:href=
+      "http://docs.ruby-doc.com/docs/ProgrammingRuby/html/language.html#UJ">Ruby Regular Expression
+      literal</link> (in the <classname>/pattern/</classname> style) to select a set of test cases.
+      You can run all of the HBase admin related tests, including both the normal administration and
+      the security administration, with the command:
+    </para>
+    <programlisting language="bourne">
+      mvn clean test -Dtest=TestShell -Dshell.test=/.*Admin.*Test/
+    </programlisting>
+    <para>
+      In the event of a test failure, you can see details by examining the XML version of the
+      surefire report results
+    </para>
+    <programlisting language="bourne">
+      vim hbase-shell/target/surefire-reports/TEST-org.apache.hadoop.hbase.client.TestShell.xml
+    </programlisting>
+  </section>
   <section xml:id="hbase.moduletest.run">
   <title>Running Tests in other Modules</title>
   <para>If the module you are developing in has no other dependencies on other HBase modules, then


[2/3] git commit: HBASE-11731 Add option to only run a subset of the shell tests (Sean Busbey)

Posted by ap...@apache.org.
HBASE-11731 Add option to only run a subset of the shell tests (Sean Busbey)

Amending-Author: Andrew Purtell <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/fc5f0a67
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/fc5f0a67
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/fc5f0a67

Branch: refs/heads/branch-1
Commit: fc5f0a672aea43aa659f5acd1b5183e407bd7ed0
Parents: a79e5ce
Author: Andrew Purtell <ap...@apache.org>
Authored: Thu Aug 14 11:49:59 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Thu Aug 14 11:50:41 2014 -0700

----------------------------------------------------------------------
 hbase-shell/src/test/ruby/tests_runner.rb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/fc5f0a67/hbase-shell/src/test/ruby/tests_runner.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/tests_runner.rb b/hbase-shell/src/test/ruby/tests_runner.rb
index 7e40962..e1458db 100644
--- a/hbase-shell/src/test/ruby/tests_runner.rb
+++ b/hbase-shell/src/test/ruby/tests_runner.rb
@@ -54,7 +54,15 @@ files.each do |file|
   end
 end
 
-if !Test::Unit::AutoRunner.run
+# If this system property is set, we'll use it to filter the test cases.
+runner_args = []
+if java.lang.System.get_property('shell.test')
+  shell_test_pattern = java.lang.System.get_property('shell.test')
+  puts "Only running tests that match #{shell_test_pattern}"
+  runner_args << "--testcase=#{shell_test_pattern}"
+end
+# first couple of args are to match the defaults, so we can pass options to limit the tests run
+if !(Test::Unit::AutoRunner.run(false, nil, runner_args))
   raise "Shell unit tests failed. Check output file for details."
 end
 


[3/3] git commit: HBASE-11731 Add option to only run a subset of the shell tests (Sean Busbey)

Posted by ap...@apache.org.
HBASE-11731 Add option to only run a subset of the shell tests (Sean Busbey)

Amending-Author: Andrew Purtell <ap...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/eb175c2f
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/eb175c2f
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/eb175c2f

Branch: refs/heads/0.98
Commit: eb175c2f113f39a70cfbd45fd6fcdf3addb1de96
Parents: 3d292e8
Author: Andrew Purtell <ap...@apache.org>
Authored: Thu Aug 14 11:49:59 2014 -0700
Committer: Andrew Purtell <ap...@apache.org>
Committed: Thu Aug 14 11:51:14 2014 -0700

----------------------------------------------------------------------
 hbase-shell/src/test/ruby/tests_runner.rb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/eb175c2f/hbase-shell/src/test/ruby/tests_runner.rb
----------------------------------------------------------------------
diff --git a/hbase-shell/src/test/ruby/tests_runner.rb b/hbase-shell/src/test/ruby/tests_runner.rb
index 7e40962..e1458db 100644
--- a/hbase-shell/src/test/ruby/tests_runner.rb
+++ b/hbase-shell/src/test/ruby/tests_runner.rb
@@ -54,7 +54,15 @@ files.each do |file|
   end
 end
 
-if !Test::Unit::AutoRunner.run
+# If this system property is set, we'll use it to filter the test cases.
+runner_args = []
+if java.lang.System.get_property('shell.test')
+  shell_test_pattern = java.lang.System.get_property('shell.test')
+  puts "Only running tests that match #{shell_test_pattern}"
+  runner_args << "--testcase=#{shell_test_pattern}"
+end
+# first couple of args are to match the defaults, so we can pass options to limit the tests run
+if !(Test::Unit::AutoRunner.run(false, nil, runner_args))
   raise "Shell unit tests failed. Check output file for details."
 end