Run tools/hacking.py instead of pep8 mandatory.

Change-Id: I81db73588ece36dec4dba90b9841ed6d0fac6a8f
This commit is contained in:
Yuriy Taraday
2012-03-14 07:35:05 +04:00
parent 9ef48ca920
commit 54afe358d9
2 changed files with 6 additions and 21 deletions

View File

@@ -39,7 +39,7 @@ from nova import log as logging
from nova.openstack.common import cfg
from nova import utils
from nova import service
from nova.tests import reset_db
from nova import tests
from nova.virt import fake
@@ -129,7 +129,7 @@ class TestCase(unittest.TestCase):
# now that we have some required db setup for the system
# to work properly.
self.start = utils.utcnow()
reset_db()
tests.reset_db()
# emulate some of the mox stuff, we can't use the metaclass
# because it screws with our generators

View File

@@ -13,9 +13,8 @@ function usage {
echo " -n, --no-recreate-db Don't recreate the test database."
echo " -x, --stop Stop running tests after the first error or failure."
echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added."
echo " -p, --pep8 Just run pep8"
echo " -P, --no-pep8 Don't run pep8"
echo " -H, --hacking Just run HACKING compliance testing"
echo " -p, --pep8 Just run PEP8 and HACKING compliance check"
echo " -P, --no-pep8 Don't run static code checks"
echo " -c, --coverage Generate coverage report"
echo " -h, --help Print this usage message"
echo " --hide-elapsed Don't print the elapsed time for each test along with slow test list"
@@ -39,7 +38,6 @@ function process_option {
-f|--force) force=1;;
-p|--pep8) just_pep8=1;;
-P|--no-pep8) no_pep8=1;;
-H|--hacking) just_hacking=1;;
-c|--coverage) coverage=1;;
-*) noseopts="$noseopts $1";;
*) noseargs="$noseargs $1"
@@ -58,7 +56,6 @@ noseopts=
wrapper=""
just_pep8=0
no_pep8=0
just_hacking=0
coverage=0
recreate_db=1
patch_migrate=1
@@ -109,16 +106,10 @@ srcfiles+=" `find ${xen_api_path} ${xen_net_path} -type f ! -name "*.patch" ! -n
srcfiles+=" setup.py"
function run_pep8 {
echo "Running pep8 ..."
echo "Running PEP8 and HACKING compliance check..."
# Just run PEP8 in current environment
#
${wrapper} pep8 ${srcfiles}
}
function run_hacking {
echo "Running hacking compliance testing..."
hacking_opts="--ignore=E202"
${wrapper} python tools/hacking.py ${hacking_opts} ${srcfiles}
${wrapper} python tools/hacking.py ${srcfiles}
}
@@ -160,12 +151,6 @@ if [ $just_pep8 -eq 1 ]; then
exit
fi
if [ $just_hacking -eq 1 ]; then
run_hacking
exit
fi
if [ $recreate_db -eq 1 ]; then
rm -f tests.sqlite
fi