Add tox support
This commit is contained in:
parent
d822d971c3
commit
16a03869c0
@ -1,3 +1,5 @@
|
|||||||
bin
|
bin
|
||||||
.coverage
|
.coverage
|
||||||
|
.tox
|
||||||
|
.testrepository
|
||||||
tags
|
tags
|
||||||
|
8
.testr.conf
Normal file
8
.testr.conf
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
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 ./ ./unit_tests $LISTOPT $IDOPTION
|
||||||
|
|
||||||
|
test_id_option=--load-list $IDFILE
|
||||||
|
test_list_option=--list
|
@ -299,8 +299,9 @@ def resource_map():
|
|||||||
|
|
||||||
conf = neutron_plugin_attribute(plugin, 'config', net_manager)
|
conf = neutron_plugin_attribute(plugin, 'config', net_manager)
|
||||||
svcs = neutron_plugin_attribute(plugin, 'services', net_manager)
|
svcs = neutron_plugin_attribute(plugin, 'services', net_manager)
|
||||||
ctxts = (neutron_plugin_attribute(plugin, 'contexts', net_manager)
|
ctxts = (neutron_plugin_attribute(plugin,
|
||||||
or [])
|
'contexts', net_manager) or
|
||||||
|
[])
|
||||||
resource_map[conf] = {}
|
resource_map[conf] = {}
|
||||||
resource_map[conf]['services'] = svcs
|
resource_map[conf]['services'] = svcs
|
||||||
resource_map[conf]['contexts'] = ctxts
|
resource_map[conf]['contexts'] = ctxts
|
||||||
@ -373,8 +374,8 @@ def determine_packages():
|
|||||||
if (net_manager in ['flatmanager', 'flatdhcpmanager'] and
|
if (net_manager in ['flatmanager', 'flatdhcpmanager'] and
|
||||||
config('multi-host').lower() == 'yes'):
|
config('multi-host').lower() == 'yes'):
|
||||||
packages.extend(['nova-api', 'nova-network'])
|
packages.extend(['nova-api', 'nova-network'])
|
||||||
elif (net_manager in ['quantum', 'neutron']
|
elif (net_manager in ['quantum', 'neutron'] and
|
||||||
and neutron_plugin_legacy_mode()):
|
neutron_plugin_legacy_mode()):
|
||||||
plugin = neutron_plugin()
|
plugin = neutron_plugin()
|
||||||
pkg_lists = neutron_plugin_attribute(plugin, 'packages', net_manager)
|
pkg_lists = neutron_plugin_attribute(plugin, 'packages', net_manager)
|
||||||
for pkg_list in pkg_lists:
|
for pkg_list in pkg_lists:
|
||||||
|
8
requirements.txt
Normal file
8
requirements.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
PyYAML>=3.10
|
||||||
|
simplejson>=3.3.1
|
||||||
|
netifaces>=0.8
|
||||||
|
netaddr>=0.7.10
|
||||||
|
Jinja2>=2.7.2
|
||||||
|
six>=1.5.2
|
||||||
|
dnspython
|
||||||
|
psutil
|
7
test-requirements.txt
Normal file
7
test-requirements.txt
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
testtools
|
||||||
|
coverage
|
||||||
|
mock
|
||||||
|
flake8==2.1.0
|
||||||
|
# No version required
|
||||||
|
charm-tools
|
||||||
|
os-testr
|
30
tox.ini
Normal file
30
tox.ini
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
[tox]
|
||||||
|
# Default to current LTS
|
||||||
|
envlist = lint,py27
|
||||||
|
skipsdist = True
|
||||||
|
|
||||||
|
[testenv]
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
PYTHONHASHSEED=0
|
||||||
|
install_command =
|
||||||
|
pip install --allow-unverified python-apt {opts} {packages}
|
||||||
|
commands = ostestr {posargs}
|
||||||
|
|
||||||
|
[testenv:py27]
|
||||||
|
basepython = python2.7
|
||||||
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
|
[testenv:lint]
|
||||||
|
basepython = python2.7
|
||||||
|
deps = -r{toxinidir}/requirements.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
commands = flake8 {posargs} hooks unit_tests tests
|
||||||
|
charm proof
|
||||||
|
|
||||||
|
[testenv:venv]
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
ignore = E402,E226
|
||||||
|
exclude = hooks/charmhelpers
|
Loading…
Reference in New Issue
Block a user