Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Warning

It's likely you are looking for is Hive PreCommit Patch Testing.

This page explains how to use parallel testing in Hive (https://issues.apache.org/jira/browse/HIVE-1487).

Table of Contents

Installation

Python modules

...

You can install the modules globally for all users with "easy_install":

Code Block

sudo easy_install argparse
sudo easy_install mako

...

If you don't have root acces on the machine, or you don't want to pollute your
system directories, you can install the modules in your home directory.

Code Block

easy_install --prefix "~/.python_modules" argparse
easy_install --prefix "~/.python_modules" mako

You'll have to update "PYTHONPATH" environmental variable to include
"~/.python_modules". You can do that by adding this line to your ".bashrc" or
".zshrc":

Code Block

export PYTHONPATH="${PYTHONPATH}:${HOME}/.python_modules/lib/pythonVERSION/site-packages"

Where "VERSION" is Python version you're using, like "2.6" or "2.7", for example
if you're using Python 2.6:

Code Block

export PYTHONPATH="${PYTHONPATH}:${HOME}/.python_modules/lib/python2.6/site-packages"

...

You will have to setup SSH so you can access all test nodes without a password.

Configuration

Configuration file

You'll need to configure on which hosts the test should run on. You should put
your configuration file in "~/.hive_ptest.conf". Configuration file format is
documented in the README file distributed with the test script.

Configuration parameter for speeding up unit tests

Unit tests will run faster if the Hive configuration parameter
hive.exec.submit.local.task.via.child is set to true. See HIVE-7271 for details.

Usage

You can see all possible options by running:

Code Block

hive_repo/testutils/ptest/hivetest.py --help

...

If you want to test a patch from Phabricator, you
can use this command:

Code Block

hive_repo/testutils/ptest/hivetest.py --test --revision D123

...

You can also test a patch from local file system.

Code Block

hive_repo/testutils/ptest/hivetest.py --test --patch /path/to/my.patch

You can provide multiple patches if you want to. They will be applied in the
same order they appear on the command line.

Code Block

hive_repo/testutils/ptest/hivetest.py --test --patch first.patch second.patch

...

The README file
distributed with the test script explains how this variable affects the paths
defined in your configuration file.

Code Block

HIVE_PTEST_SUFFIX=first_run hive_repo/testutils/ptest/hivetest.py --test &
HIVE_PTEST_SUFFIX=second_run hive_repo/testutils/ptest/hivetest.py --test &

...

If you want to use a fixed report name instead of a timestamp, you can use
"--report-name" switch, for example:

Code Block

hive_repo/testuitls/ptest/hivetest.py --test --revision D123 --report-name D123

...