diff options
author | Joe Gordon <jogo@cloudscaling.com> | 2012-01-20 00:50:56 -0800 |
---|---|---|
committer | Joe Gordon <jogo@cloudscaling.com> | 2012-01-24 10:54:17 -0800 |
commit | 9a08e00548d1414f4a4ed3901ed4b4dc817c3f1a (patch) | |
tree | 931d8f0132ae7eddbb9f61e9a3c2744aa0b8db7a /run_tests.sh | |
parent | 1963e6bfd9bd2d4bbecf1edb4e8021e15f4086cc (diff) | |
download | nova-9a08e00548d1414f4a4ed3901ed4b4dc817c3f1a.tar.gz |
Add HACKING compliance testing to run_test.sh
Tests so far:
N101 TODO format
N201 Except format
N301 One import per line
N302 import only modules
N303 Invalid Import
N304 Relative Import
Change-Id: I33c021b842e7199b1f5f1f699ea17f7fa5f8ca49
Diffstat (limited to 'run_tests.sh')
-rwxr-xr-x | run_tests.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/run_tests.sh b/run_tests.sh index 112a55ca56..e3cf69a365 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -15,6 +15,7 @@ function usage { 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 " -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" @@ -36,6 +37,7 @@ 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" @@ -54,6 +56,7 @@ noseopts= wrapper="" just_pep8=0 no_pep8=0 +just_hacking=0 coverage=0 recreate_db=1 @@ -116,6 +119,21 @@ function run_pep8 { ${wrapper} pep8 ${pep8_opts} ${srcfiles} } +function run_hacking { + echo "Running hacking compliance testing..." + # Opt-out files from pep8 + ignore_scripts="*.sh:*nova-debug:*clean-vlans:*.swp" + ignore_files="*eventlet-patch:*pip-requires" + ignore_dirs="*ajaxterm*" + GLOBIGNORE="$ignore_scripts:$ignore_files:$ignore_dirs" + srcfiles=`find bin -type f ! -name "nova.conf*"` + srcfiles+=" `find tools/*`" + srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance" + hacking_opts="--ignore=E202,W602 --repeat" + ${wrapper} python tools/hacking.py ${hacking_opts} ${srcfiles} +} + + NOSETESTS="python nova/testing/runner.py $noseopts $noseargs" if [ $never_venv -eq 0 ] @@ -154,6 +172,12 @@ 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 |