From c5e9426bb588faacac8b8a661afc560241640e41 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 24 Dec 2012 22:50:58 -0600 Subject: [PATCH] Migrate to testr. Part of blueprint grizzly-testtools Change-Id: I9a12f0300e2731a6ee0a82e1f9737a6b83aa5d85 --- .gitignore | 2 ++ .testr.conf | 4 ++++ setup.cfg | 8 -------- setup.py | 1 - tools/test-requires | 8 +++----- tox.ini | 23 +++++++++++++---------- 6 files changed, 22 insertions(+), 24 deletions(-) create mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 4717a986..114b2af5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .coverage +subunit.log .venv *,cover cover @@ -12,6 +13,7 @@ dist python_glanceclient.egg-info ChangeLog run_tests.err.log +.testrepository .tox doc/source/api *.egg diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 00000000..081907d5 --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION +test_id_option=--load-list $IDFILE +test_list_option=--list diff --git a/setup.cfg b/setup.cfg index 198deef7..11c72013 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,11 +1,3 @@ -[nosetests] -cover-package = glanceclient -cover-html = true -cover-erase = true -cover-inclusive = true -verbosity=2 -detailed-errors=1 - [build_sphinx] source-dir = doc/source build-dir = doc/build diff --git a/setup.py b/setup.py index b7e99ff0..610fac29 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,6 @@ setuptools.setup( dependency_links=dependency_links, tests_require=tests_require, setup_requires=['setuptools-git>=0.4'], - test_suite="nose.collector", entry_points={'console_scripts': ['glance = glanceclient.shell:main']}, data_files=[('glanceclient', ['glanceclient/versioninfo'])] ) diff --git a/tools/test-requires b/tools/test-requires index f1ae9bdc..b6ea0cb7 100644 --- a/tools/test-requires +++ b/tools/test-requires @@ -1,12 +1,10 @@ distribute>=0.6.24 +coverage +discover mox -nose -nose-exclude -nosexcover -openstack.nose_plugin -nosehtmloutput pep8==1.3.3 setuptools-git>=0.4 sphinx>=1.1.2 +testrepository>=0.0.13 testtools>=0.9.22 diff --git a/tox.ini b/tox.ini index f95fe8ef..17bb1720 100644 --- a/tox.ini +++ b/tox.ini @@ -3,21 +3,24 @@ envlist = py26,py27,pep8 [testenv] setenv = VIRTUAL_ENV={envdir} - NOSE_WITH_OPENSTACK=1 - NOSE_OPENSTACK_COLOR=1 - NOSE_OPENSTACK_RED=0.05 - NOSE_OPENSTACK_YELLOW=0.025 - NOSE_OPENSTACK_SHOW_ELAPSED=1 - NOSE_OPENSTACK_STDOUT=1 + LANG=en_US.UTF-8 + LANGUAGE=en_US:en + LC_ALL=C + OS_STDOUT_NOCAPTURE=False + OS_STDERR_NOCAPTURE=False + deps = -r{toxinidir}/tools/pip-requires -r{toxinidir}/tools/test-requires -commands = nosetests {posargs} +commands = python setup.py testr --testr-args='{posargs}' [testenv:pep8] commands = pep8 --repeat --show-source --exclude=.venv,.tox,dist,doc,*egg . -[testenv:cover] -commands = nosetests --cover-erase --cover-package=glanceclient --with-xcoverage - [testenv:venv] commands = {posargs} + +[testenv:cover] +commands = python setup.py testr --coverage --testr-args='{posargs}' + +[tox:jenkins] +downloadcache = ~/cache/pip