Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 21134 invoked from network); 24 Jan 2009 14:12:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Jan 2009 14:12:57 -0000 Received: (qmail 90987 invoked by uid 500); 24 Jan 2009 14:12:56 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 90951 invoked by uid 500); 24 Jan 2009 14:12:56 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 90942 invoked by uid 99); 24 Jan 2009 14:12:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jan 2009 06:12:56 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 24 Jan 2009 14:12:50 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id A1F84118F3 for ; Sat, 24 Jan 2009 14:12:30 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: core-commits@hadoop.apache.org Date: Sat, 24 Jan 2009 14:12:30 -0000 Message-ID: <20090124141230.4754.73984@eos.apache.org> Subject: [Hadoop Wiki] Update of "Hive/DeveloperGuide" by DavidPhillips X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification. The following page has been changed by DavidPhillips: http://wiki.apache.org/hadoop/Hive/DeveloperGuide ------------------------------------------------------------------------------ == Unit tests == === Layout of the unit tests === - Hive uses junit for unit tests. Each of the 3 main components of Hive have their unit test implementations in the corresponding src/test directory e.g. trunk/metastore/src/test has all the unit tests for metastore, trunk/serde/src/test has all the unit tests for serde and trunk/ql/src/test has all the unit tests for the query processor. The metastore and serde unit tests provide the TestCase implementations for junit. The query processor tests on the other hand are generated using Velocity. The main directories under trunk/ql/src/test that contain these tests and the corresponding results are as follows: + Hive uses junit for unit tests. Each of the 3 main components of Hive have their unit test implementations in the corresponding src/test directory e.g. trunk/metastore/src/test has all the unit tests for metastore, trunk/serde/src/test has all the unit tests for serde and trunk/ql/src/test has all the unit tests for the query processor. The metastore and serde unit tests provide the !TestCase implementations for junit. The query processor tests on the other hand are generated using Velocity. The main directories under trunk/ql/src/test that contain these tests and the corresponding results are as follows: * Test Queries: * queries/clientnegative - This directory contains the query files (.q files) for the negative test cases. These are run through the CLI classes and therefore test the entire query processor stack. * queries/clientpositive - This directory contains the query files (.q files) for the positive test cases. Thesre are run through the CLI classes and therefore test the entire query processor stack. @@ -117, +117 @@ * results/compiler/parse - The expected Abstract Syntax Tree output for the queries in queries/positive. * results/compiler/plan - The expected query plans for the queries in queries/positive. * Velocity Templates to Generate the tests: - * templates/TestCliDriver.vm - Generates the tests from queries/clientpositive. + * templates/!TestCliDriver.vm - Generates the tests from queries/clientpositive. - * templates/TestNegativeCliDriver.vm - Generates the tests from queries/clientnegative. + * templates/!TestNegativeCliDriver.vm - Generates the tests from queries/clientnegative. - * templates/TestParse.vm - Generates the tests from queries/positive. + * templates/!TestParse.vm - Generates the tests from queries/positive. - * templates/TestParseNegative.vm - Generates the tests from queries/negative. + * templates/!TestParseNegative.vm - Generates the tests from queries/negative. === Tables in the unit tests === === Running unit tests === + Run all tests: + {{{ + ant test + }}} + + Run all positive test queries: + {{{ + ant test -Dtestcase=TestCliDriver + }}} + + Run a specific positive test query: + {{{ + ant test -Dtestcase=TestCliDriver -Dqfile=groupby1.q + }}} + + The about test produces the following files: + * {{{build/ql/test/TEST-org.apache.hadoop.hive.cli.TestCliDriver.txt}}} - Log output for the test. This can be helpful when examining test failures. + * {{{build/ql/test/logs/groupby1.q.out}}} - Actual query result for the test. This result is compared to the expected result as part of the test. + === Adding new unit tests === == Pluggable interfaces ==