Add tox support
This commit is contained in:
parent
802ac4d57f
commit
861de65957
|
@ -1,2 +1,5 @@
|
||||||
bin
|
bin
|
||||||
.coverage
|
.coverage
|
||||||
|
.testrepository
|
||||||
|
.tox
|
||||||
|
tags
|
||||||
|
|
|
@ -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
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
import sys
|
import sys
|
||||||
import uuid
|
|
||||||
|
|
||||||
sys.path.append('hooks/')
|
sys.path.append('hooks/')
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
# The order of packages is significant, because pip processes them in the order
|
||||||
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
|
# process, which may cause wedges in the gate later.
|
||||||
|
PyYAML>=3.1.0
|
||||||
|
simplejson>=2.2.0
|
||||||
|
netifaces>=0.10.4
|
||||||
|
netaddr>=0.7.12,!=0.7.16
|
||||||
|
Jinja2>=2.6 # BSD License (3 clause)
|
||||||
|
six>=1.9.0
|
||||||
|
dnspython>=1.12.0
|
||||||
|
psutil>=1.1.1,<2.0.0
|
|
@ -0,0 +1,8 @@
|
||||||
|
# The order of packages is significant, because pip processes them in the order
|
||||||
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
|
# process, which may cause wedges in the gate later.
|
||||||
|
coverage>=3.6
|
||||||
|
mock>=1.2
|
||||||
|
flake8>=2.2.4,<=2.4.1
|
||||||
|
os-testr>=0.4.1
|
||||||
|
charm-tools
|
|
@ -468,7 +468,7 @@ class CeiloAgentBasicDeployment(OpenStackAmuletDeployment):
|
||||||
'auth_uri': auth_uri,
|
'auth_uri': auth_uri,
|
||||||
'auth_host': ks_rel['auth_host'],
|
'auth_host': ks_rel['auth_host'],
|
||||||
'auth_port': ks_rel['auth_port'],
|
'auth_port': ks_rel['auth_port'],
|
||||||
'auth_protocol': ks_rel['auth_protocol'],
|
'auth_protocol': ks_rel['auth_protocol'],
|
||||||
'admin_tenant_name': 'services',
|
'admin_tenant_name': 'services',
|
||||||
'admin_user': 'ceilometer',
|
'admin_user': 'ceilometer',
|
||||||
'admin_password': ks_rel['service_password'],
|
'admin_password': ks_rel['service_password'],
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
[tox]
|
||||||
|
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 actions
|
||||||
|
charm proof
|
||||||
|
|
||||||
|
[testenv:venv]
|
||||||
|
commands = {posargs}
|
||||||
|
|
||||||
|
[flake8]
|
||||||
|
ignore = E402,E226
|
||||||
|
exclude = hooks/charmhelpers
|
|
@ -13,7 +13,6 @@ from test_utils import (
|
||||||
TO_PATCH = [
|
TO_PATCH = [
|
||||||
'config_changed',
|
'config_changed',
|
||||||
'do_openstack_upgrade',
|
'do_openstack_upgrade',
|
||||||
'uuid'
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,7 @@ class CeilometerUtilsTest(CharmTestCase):
|
||||||
configs = MagicMock()
|
configs = MagicMock()
|
||||||
utils.do_openstack_upgrade(configs)
|
utils.do_openstack_upgrade(configs)
|
||||||
configs.set_release.assert_called_with(openstack_release='havana')
|
configs.set_release.assert_called_with(openstack_release='havana')
|
||||||
self.log.assert_called()
|
self.assertTrue(self.log.called)
|
||||||
self.apt_update.assert_called_with(fatal=True)
|
self.apt_update.assert_called_with(fatal=True)
|
||||||
dpkg_opts = [
|
dpkg_opts = [
|
||||||
'--option', 'Dpkg::Options::=--force-confnew',
|
'--option', 'Dpkg::Options::=--force-confnew',
|
||||||
|
|
Loading…
Reference in New Issue