Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DEA78118D6 for ; Thu, 14 Aug 2014 18:52:14 +0000 (UTC) Received: (qmail 67911 invoked by uid 500); 14 Aug 2014 18:52:14 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 67866 invoked by uid 500); 14 Aug 2014 18:52:14 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 67848 invoked by uid 99); 14 Aug 2014 18:52:14 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Aug 2014 18:52:14 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 6BAA49C3823; Thu, 14 Aug 2014 18:52:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: apurtell@apache.org To: commits@hbase.apache.org Date: Thu, 14 Aug 2014 18:52:14 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Thu Aug 14 11:49:59 2014 -0700 Committer: Andrew Purtell 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. 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). +
+ Testing the HBase Shell + + 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, + TestShell, that takes care of loading the jruby implemented tests and + running them. You can run all of these tests from the top level with: + + + mvn clean test -Dtest=TestShell + + + Alternatively, you may limit the shell tests that run using the system variable + shell.test. 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 AdminAlterTableTest and you can run them with: + + + mvn clean test -Dtest=TestShell -Dshell.test=AdminAlterTableTest + + + You may also use a Ruby Regular Expression + literal (in the /pattern/ 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: + + + mvn clean test -Dtest=TestShell -Dshell.test=/.*Admin.*Test/ + + + In the event of a test failure, you can see details by examining the XML version of the + surefire report results + + + vim hbase-shell/target/surefire-reports/TEST-org.apache.hadoop.hbase.client.TestShell.xml + +
Running Tests in other Modules If the module you are developing in has no other dependencies on other HBase modules, then