Add tox.ini file.

Fixed pep8 run, which always return success. And one 1.1 pep8 error.

Change-Id: I2f1dd7c61b7fd0816bf7697f74e306d17f908fa5
This commit is contained in:
Monty Taylor 2012-06-14 17:37:18 -04:00 committed by James E. Blair
parent 8f1ea73606
commit b7ecdb765a
3 changed files with 31 additions and 2 deletions

View File

@ -180,7 +180,7 @@ class TestCase(django_test.TestCase):
message_cookie = self.client.cookies['messages'].value
messages = storage._decode(message_cookie)
# Check for messages in the context
elif hasattr(response, "context") and "messages" in response.context:
elif hasattr(response, "context") and "messages" in response.context:
messages = response.context["messages"]
# Check for messages attached to the request on a TemplateResponse
elif hasattr(response, "_request") and hasattr(response._request,

View File

@ -120,7 +120,7 @@ function run_pep8 {
PEP8_EXCLUDE=vcsversion.py
PEP8_IGNORE=W602
PEP8_OPTIONS="--exclude=$PEP8_EXCLUDE --ignore=$PEP8_IGNORE --repeat"
${command_wrapper} pep8 $PEP8_OPTIONS $included_dirs | perl -ple 's/: ([WE]\d+)/: [$1]/' > pep8.txt || true
${command_wrapper} pep8 $PEP8_OPTIONS $included_dirs > pep8.txt || true
PEP8_COUNT=`wc -l pep8.txt | awk '{ print $1 }'`
if [ $PEP8_COUNT -ge 1 ]; then
echo "PEP8 violations found ($PEP8_COUNT):"
@ -129,6 +129,7 @@ function run_pep8 {
else
echo "No violations found. Good job!"
fi
exit $PEP8_COUNT
}
function run_sphinx {
@ -269,12 +270,14 @@ function run_tests {
sanity_check
echo "Running Horizon application tests"
export NOSE_XUNIT_FILE=horizon/nosetests.xml
${command_wrapper} coverage erase
${command_wrapper} coverage run -p $root/manage.py test horizon --settings=horizon.tests.testsettings $testargs
# get results of the Horizon tests
HORIZON_RESULT=$?
echo "Running openstack_dashboard tests"
export NOSE_XUNIT_FILE=openstack_dashboard/nosetests.xml
if [ $selenium -eq 1 ]; then
${command_wrapper} coverage run -p $root/manage.py test openstack_dashboard --settings=horizon.tests.testsettings --with-selenium --with-cherrypyliveserver $testargs
else

26
tox.ini Normal file
View File

@ -0,0 +1,26 @@
[tox]
envlist = py26,py27,pep8
[testenv]
setenv = VIRTUAL_ENV={envdir}
NOSE_WITH_OPENSTACK=1
NOSE_OPENSTACK_COLOR=1
NOSE_OPENSTACK_RED=0.05
NOSE_OPENSTACK_YELLOW=0.025
NOSE_OPENSTACK_SHOW_ELAPSED=1
deps = -r{toxinidir}/tools/pip-requires
-r{toxinidir}/tools/test-requires
commands = /bin/bash run_tests.sh -N
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv:pep8]
deps = pep8==1.1
commands = /bin/bash run_tests.sh -N --pep8
[testenv:cover]
commands = /bin/bash run_tests.sh -N --coverage
[testenv:venv]
commands = {posargs}