From a4dafcd6a11b2d120a3fa22ff92ec78b62bac59c Mon Sep 17 00:00:00 2001 From: Flavio Percoco Date: Thu, 30 Jan 2014 10:57:14 +0100 Subject: [PATCH] Add requirements and testr --- .testr.conf | 8 +++++++ requirements.txt | 12 +++++++++++ test-requirements.txt | 11 ++++++++++ tox.ini | 49 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 80 insertions(+) create mode 100644 .testr.conf create mode 100644 requirements.txt create mode 100644 test-requirements.txt create mode 100644 tox.ini diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 00000000..42a77d38 --- /dev/null +++ b/.testr.conf @@ -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 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..2e4f35bb --- /dev/null +++ b/requirements.txt @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 00000000..a975a91f --- /dev/null +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..bbf5f131 --- /dev/null +++ b/tox.ini @@ -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._ +