Warning |
---|
It's likely you are looking for 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 &
|
...
After the test run ends, a test report will be generated in
"~/hivetests/reportsreport/TIMESTAMP"; the main file is named "report.html". Since
JUnit properties lists take up a lot of space, by default they are generated in
separate ".html" files and linked from "report.html". If you want to generate
just one file (for easy copying for example) you can use "--one-file-report"
switch and the properties will be embedded in "report.html". Keep in mind that
instead of getting a ~300k file, you'll get one that might be more than 10MB.
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
|
This will generate report in "~/hivetests/reportsreport/D123". If there was already a
report with that name it will be removed.
...
".q.out" files from TestCliDriver and TestNegativeCliDriver runs will be copied
to "~/hivetests/reportsreport/TIMESTAMP/out" so they are available in one place.
...
"hive.log" files from all test runs will be copied to
"~/hivetests/reportsreport/TIMESTAMP/outlogs" and will be renamed to
"hive-HOST-TESTCASE.log".
...