Add tox configurations and requirements definitions
This commit is contained in:
parent
a57e35e5af
commit
fbde2aab1f
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
|
@ -146,8 +146,8 @@ def config_changed():
|
||||
umount(e_mountpoint)
|
||||
|
||||
osd_journal = config('osd-journal')
|
||||
if (osd_journal and not os.path.exists(JOURNAL_ZAPPED)
|
||||
and os.path.exists(osd_journal)):
|
||||
if (osd_journal and not os.path.exists(JOURNAL_ZAPPED) and
|
||||
os.path.exists(osd_journal)):
|
||||
ceph.zap_disk(osd_journal)
|
||||
with open(JOURNAL_ZAPPED, 'w') as zapped:
|
||||
zapped.write('DONE')
|
||||
|
6
requirements/requirements-precise.txt
Normal file
6
requirements/requirements-precise.txt
Normal file
@ -0,0 +1,6 @@
|
||||
PyYAML==3.10
|
||||
simplejson==2.3.2
|
||||
netifaces==0.8
|
||||
netaddr==0.7.10
|
||||
Jinja2==2.6
|
||||
six==1.1.0
|
7
requirements/requirements-trusty.txt
Normal file
7
requirements/requirements-trusty.txt
Normal file
@ -0,0 +1,7 @@
|
||||
PyYAML>=3.10
|
||||
simplejson>=3.3.1
|
||||
netifaces>=0.8
|
||||
netaddr>=0.7.10
|
||||
Jinja2>=2.7.2
|
||||
six>=1.5.2
|
||||
dnspython
|
7
requirements/test-requirements.txt
Normal file
7
requirements/test-requirements.txt
Normal file
@ -0,0 +1,7 @@
|
||||
testtools
|
||||
coverage
|
||||
mock
|
||||
flake8==2.1.0
|
||||
# No version required
|
||||
charm-tools
|
||||
os-testr
|
35
tox.ini
Normal file
35
tox.ini
Normal file
@ -0,0 +1,35 @@
|
||||
[tox]
|
||||
# Default to current LTS
|
||||
envlist = lint,py27-trusty
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
PYTHONHASHSEED=0
|
||||
install_command =
|
||||
pip install --allow-unverified python-apt {opts} {packages}
|
||||
commands = ostestr {posargs}
|
||||
|
||||
[testenv:py27-precise]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/requirements/requirements-precise.txt
|
||||
-r{toxinidir}/requirements/test-requirements.txt
|
||||
|
||||
[testenv:py27-trusty]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/requirements/requirements-trusty.txt
|
||||
-r{toxinidir}/requirements/test-requirements.txt
|
||||
|
||||
[testenv:lint]
|
||||
basepython = python2.7
|
||||
deps = -r{toxinidir}/requirements/requirements-trusty.txt
|
||||
-r{toxinidir}/requirements/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