Improvements to tox envs

- Actually depend on requirements.txt
- Run unit tests with ostestr
- Inform testr of location of unit tests
- Fix coverage job and include report
- Keep PEP8 strict; it's not annoying yet
- Remove vestiges of oslo incubator handling

Change-Id: I2465d18bee8e242e049d2d5e30dfcf472a49c0c4
This commit is contained in:
Henry Gessau 2015-12-10 00:58:12 -05:00
parent 42c178cd3d
commit 452c3ab8a8
6 changed files with 18 additions and 20 deletions

View File

@ -1,7 +1,7 @@
[run]
branch = True
source = neutron_lib
omit = neutron_lib/openstack/*
omit = neutron_lib/tests/*
[report]
ignore_errors = True

View File

@ -2,6 +2,7 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
${PYTHON:-python} -m subunit.run discover -t ./ \
${OS_TEST_PATH:-./neutron_lib/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -115,7 +115,8 @@ class CallBacksManagerTestCase(base.BaseTestCase):
callback_1, resources.PORT, events.BEFORE_CREATE)
self.assertNotIn(callback_id_1, self.manager._index)
self.assertNotIn(callback_id_1,
self.manager._callbacks[resources.PORT][events.BEFORE_CREATE])
self.manager._callbacks[resources.PORT]
[events.BEFORE_CREATE])
def test_unsubscribe_by_resource(self):
self.manager.subscribe(

View File

@ -1,6 +0,0 @@
[DEFAULT]
# The list of modules to copy from oslo-incubator.git
# The base module to hold the copy of openstack.common
base=neutron_lib

View File

@ -10,6 +10,7 @@ python-subunit>=0.0.18
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
os-testr>=0.4.1
testrepository>=0.0.18
testscenarios>=0.4
testtools>=1.4.0

23
tox.ini
View File

@ -1,15 +1,19 @@
[tox]
minversion = 1.6
minversion = 2.0
envlist = py34,py27,pep8
skipsdist = True
[testenv]
usedevelop = True
passenv = TRACE_FAILONLY
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
VIRTUAL_ENV={envdir}
deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
ostestr --regex '{posargs}'
[testenv:pep8]
commands = flake8
@ -18,7 +22,9 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
commands =
python setup.py test --coverage --coverage-package-name=neutron_lib --testr-args='{posargs}'
coverage report
[testenv:docs]
commands = sphinx-build -W -b html doc/source doc/build/html
@ -27,11 +33,6 @@ commands = sphinx-build -W -b html doc/source doc/build/html
commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual indent
show-source = True
ignore = E123,E125,E126,E128
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build