From 07bbe577542b1e0c81d8fe9880df9955e0583d73 Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Wed, 14 Mar 2012 07:35:05 +0400 Subject: [PATCH] Run tools/hacking.py instead of pep8 mandatory. Change-Id: I81db73588ece36dec4dba90b9841ed6d0fac6a8f --- nova/network/quantum/melange_ipam_lib.py | 2 +- nova/test.py | 4 ++-- run_tests.sh | 23 ++++------------------- 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/nova/network/quantum/melange_ipam_lib.py b/nova/network/quantum/melange_ipam_lib.py index ad5e4aefb0ec..fbb1dfad68fa 100644 --- a/nova/network/quantum/melange_ipam_lib.py +++ b/nova/network/quantum/melange_ipam_lib.py @@ -221,7 +221,7 @@ class QuantumMelangeIPAMLib(object): def get_instance_ids_by_ip_address(self, context, address): ips = self.m_conn.get_allocated_ips_by_address(address) - # TODO (aaron.lee) melange should be storing & returning instance_uuid! + # TODO(aaron.lee): melange should be storing & returning instance_uuid! return [ip.get('used_by_device') for ip in ips] def verify_subnet_exists(self, context, project_id, quantum_net_id): diff --git a/nova/test.py b/nova/test.py index c269b23f7b44..b1ce0622df74 100644 --- a/nova/test.py +++ b/nova/test.py @@ -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 diff --git a/run_tests.sh b/run_tests.sh index 4e86d0c81d3d..ce48e9f1e3b7 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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