Add requirements and testr

This commit is contained in:
Flavio Percoco 2014-01-30 10:57:14 +01:00
parent 0afd5e2e4a
commit a4dafcd6a1
4 changed files with 80 additions and 0 deletions

8
.testr.conf Normal file
View 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 . ./tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

12
requirements.txt Normal file
View File

@ -0,0 +1,12 @@
pbr>=0.5.21,<1.0
oslo.config>=1.2.0
stevedore>=0.12
# For Swift storage backend.
python-swiftclient>=1.5
python-cinderclient>=1.0.6
# Required by openstack.common libraries
six>=1.4.1

11
test-requirements.txt Normal file
View File

@ -0,0 +1,11 @@
# Metrics and style
hacking>=0.8.0,<0.9
# Packaging
mock>=1.0
# Unit testing
fixtures>=0.3.14
python-subunit
testrepository>=0.0.17
testtools>=0.9.32

49
tox.ini Normal file
View File

@ -0,0 +1,49 @@
[tox]
minversion = 1.6
envlist = py26,py27,py33,pypy,pep8,lint2,lint3
skipsdist = True
[testenv]
usedevelop = True
# Customize pip command, add -U to force updates.
install_command = pip install -U {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
GLANCE_STORE_TESTS_DIR={toxinidir}/tests
GLANCE_STORE_TESTS_CONFIGS_DIR={toxinidir}/tests/etc/
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
#commands = nosetests {posargs}
commands = python setup.py testr --slowest --testr-args='--concurrency 1 {posargs}'
[tox:jenkins]
downloadcache = ~/cache/pip
[testenv:pep8]
commands = flake8
[testenv:lint2]
basepython = python2
deps = pylint
commands = pylint ./glance.store ./tests -E --ignore ./openstack
[testenv:lint3]
basepython = python3
deps = pylint
commands = pylint ./glance.store ./tests -E --ignore ./openstack
[testenv:cover]
setenv = NOSE_WITH_COVERAGE=1
commands =
python setup.py testr --coverage \
--testr-args='^(?!.*test.*coverage).*$'
[testenv:venv]
commands = {posargs}
[flake8]
exclude = .venv*,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*.egg,.update-venv
[hacking]
import_exceptions = glance.store.openstack.common.gettextutils._