Deprecate run_tests.sh

This commit deprecates run_tests.sh script and adds a deprecation
document. We don't pay attention this script actually however, I suppose
new people are coming and see the top of the directory and find this
script and try to use this. And if something wrong happens, we need to
ask and check 'which runner did you use?'. So I would like to reduce the
ways to execute unit tests.

Change-Id: Ia764fa3a15dc9faa753d4aca4c76462a8b9dd40b
This commit is contained in:
Masayuki Igawa 2016-06-02 16:09:50 +09:00
parent 6bf195e555
commit afb1143147
2 changed files with 42 additions and 3 deletions

View File

@ -178,9 +178,8 @@ should only be run on the unit test directory. The default value of OS_TEST_PATH
is OS_TEST_PATH=./tempest/test_discover which will only run test discover on the is OS_TEST_PATH=./tempest/test_discover which will only run test discover on the
Tempest suite. Tempest suite.
Alternatively, you can use the run_tests.sh script which will create a venv and Alternatively, there are the py27 and py34 tox jobs which will run the unit
run the unit tests. There are also the py27 and py34 tox jobs which will run tests with the corresponding version of python.
the unit tests with the corresponding version of python.
Python 2.6 Python 2.6
---------- ----------

View File

@ -17,6 +17,44 @@ function usage {
echo " -- [TESTROPTIONS] After the first '--' you can pass arbitrary arguments to testr " echo " -- [TESTROPTIONS] After the first '--' you can pass arbitrary arguments to testr "
} }
function deprecation_warning {
cat <<EOF
-------------------------------------------------------------------------
WARNING: run_tests.sh is deprecated and this script will be removed after
the Newton release. All tests should be run through testr/ostestr or tox.
To run style checks:
tox -e pep8
To run python 2.7 unit tests
tox -e py27
To run unit tests and generate coverage report
tox -e cover
To run a subset of any of these tests:
tox -e py27 someregex
i.e.: tox -e py27 test_servers
Additional tox targets are available in tox.ini. For more information
see:
http://docs.openstack.org/project-team-guide/project-setup/python.html
NOTE: if you want to use testr to run tests, you can instead use:
OS_TEST_PATH=./tempest/tests testr run
Documentation on using testr directly can be found at
http://testrepository.readthedocs.org/en/latest/MANUAL.html
-------------------------------------------------------------------------
EOF
}
testrargs="" testrargs=""
just_pep8=0 just_pep8=0
venv=${VENV:-.venv} venv=${VENV:-.venv}
@ -32,6 +70,8 @@ wrapper=""
config_file="" config_file=""
update=0 update=0
deprecation_warning
if ! options=$(getopt -o VNnfuctphd -l virtual-env,no-virtual-env,no-site-packages,force,update,serial,coverage,pep8,help,debug -- "$@") if ! options=$(getopt -o VNnfuctphd -l virtual-env,no-virtual-env,no-site-packages,force,update,serial,coverage,pep8,help,debug -- "$@")
then then
# parse error # parse error