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:
parent
42c178cd3d
commit
452c3ab8a8
@ -1,7 +1,7 @@
|
|||||||
[run]
|
[run]
|
||||||
branch = True
|
branch = True
|
||||||
source = neutron_lib
|
source = neutron_lib
|
||||||
omit = neutron_lib/openstack/*
|
omit = neutron_lib/tests/*
|
||||||
|
|
||||||
[report]
|
[report]
|
||||||
ignore_errors = True
|
ignore_errors = True
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
|
||||||
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
|
||||||
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
|
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_id_option=--load-list $IDFILE
|
||||||
test_list_option=--list
|
test_list_option=--list
|
||||||
|
@ -115,7 +115,8 @@ class CallBacksManagerTestCase(base.BaseTestCase):
|
|||||||
callback_1, resources.PORT, events.BEFORE_CREATE)
|
callback_1, resources.PORT, events.BEFORE_CREATE)
|
||||||
self.assertNotIn(callback_id_1, self.manager._index)
|
self.assertNotIn(callback_id_1, self.manager._index)
|
||||||
self.assertNotIn(callback_id_1,
|
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):
|
def test_unsubscribe_by_resource(self):
|
||||||
self.manager.subscribe(
|
self.manager.subscribe(
|
||||||
|
@ -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
|
|
@ -10,6 +10,7 @@ python-subunit>=0.0.18
|
|||||||
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
|
sphinx!=1.2.0,!=1.3b1,<1.3,>=1.1.2
|
||||||
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
|
oslosphinx!=3.4.0,>=2.5.0 # Apache-2.0
|
||||||
oslotest>=1.10.0 # Apache-2.0
|
oslotest>=1.10.0 # Apache-2.0
|
||||||
|
os-testr>=0.4.1
|
||||||
testrepository>=0.0.18
|
testrepository>=0.0.18
|
||||||
testscenarios>=0.4
|
testscenarios>=0.4
|
||||||
testtools>=1.4.0
|
testtools>=1.4.0
|
||||||
|
21
tox.ini
21
tox.ini
@ -1,15 +1,19 @@
|
|||||||
[tox]
|
[tox]
|
||||||
minversion = 1.6
|
minversion = 2.0
|
||||||
envlist = py34,py27,pep8
|
envlist = py34,py27,pep8
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
passenv = TRACE_FAILONLY
|
||||||
install_command = pip install -U {opts} {packages}
|
install_command = pip install -U {opts} {packages}
|
||||||
setenv =
|
setenv =
|
||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps =
|
||||||
commands = python setup.py test --slowest --testr-args='{posargs}'
|
-r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands =
|
||||||
|
ostestr --regex '{posargs}'
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = flake8
|
commands = flake8
|
||||||
@ -18,7 +22,9 @@ commands = flake8
|
|||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[testenv:cover]
|
[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]
|
[testenv:docs]
|
||||||
commands = sphinx-build -W -b html doc/source doc/build/html
|
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}
|
commands = oslo_debug_helper {posargs}
|
||||||
|
|
||||||
[flake8]
|
[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
|
show-source = True
|
||||||
ignore = E123,E125,E126,E128
|
|
||||||
builtins = _
|
builtins = _
|
||||||
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|
||||||
|
Loading…
Reference in New Issue
Block a user