Added an option to run_tests.sh so you can run just pep8. So now you can:
./run_tests.sh --just-pep8 or ./run_tests.sh -p
This commit is contained in:
1 changed files with 20 additions and 7 deletions
27
run_tests.sh
27
run_tests.sh
@@ -7,6 +7,7 @@ function usage {
echo " -V, --virtual-env Always use virtualenv. Install automatically if not present"
echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local environment"
echo " -f, --force Force a clean re-build of the virtual environment. Useful when dependencies have been added."
echo " -p, --just-pep8 Just run pep8"
echo " -h, --help Print this usage message"
echo ""
echo "Note: with no options specified, the script will try to run the tests in a virtual environment,"
@@ -21,6 +22,7 @@ function process_option {
-V|--virtual-env) let always_venv=1; let never_venv=0;;
-N|--no-virtual-env) let always_venv=0; let never_venv=1;;
-f|--force) let force=1;;
-p|--just-pep8) let just_pep8=1;;
*) noseargs="$noseargs1ドル"
esac
}
@@ -32,6 +34,7 @@ never_venv=0
force=0
noseargs=
wrapper=""
just_pep8=0
for arg in "$@"; do
process_option $arg
@@ -53,6 +56,18 @@ function run_tests {
return $RESULT
}
function run_pep8 {
echo "Running pep8 ..."
srcfiles=`find bin -type f ! -name "nova.conf*"`
srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance"
pep8 --repeat --show-pep8 --show-source --exclude=vcsversion.py ${srcfiles}
}
if [ $just_pep8 -eq 1 ]; then
run_pep8
exit
fi
NOSETESTS="python run_tests.py $noseargs"
if [ $never_venv -eq 0 ]
@@ -81,11 +96,9 @@ then
fi
fi
if [ -z "$noseargs" ];
then
srcfiles=`find bin -type f ! -name "nova.conf*"`
srcfiles+=" nova setup.py plugins/xenserver/xenapi/etc/xapi.d/plugins/glance"
run_tests && pep8 --repeat --show-pep8 --show-source --exclude=vcsversion.py ${srcfiles} || exit 1
else
run_tests
run_tests
# Also run pep8 if no options were provided.
if [ -z "$noseargs" ]; then
run_pep8
fi
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.