From 3926f35df775bcc44628070cbe29e252d51987cf Mon Sep 17 00:00:00 2001 From: Josh Kearney Date: Tue, 22 Jan 2013 11:09:11 -0600 Subject: [PATCH] Migrate from nose to testr. Run tests with testr for parallel execution. Part of blueprint grizzly-testtools. Change-Id: I560592186f2f440049a451a32e58067262ab62d0 --- .gitignore | 1 + .testr.conf | 4 ++++ setup.cfg | 8 -------- setup.py | 1 - tox.ini | 32 +++++--------------------------- 5 files changed, 10 insertions(+), 36 deletions(-) create mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index e038b53..8b413ce 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.swp *~ .openstackclient-venv +.testrepository .tox .venv AUTHORS diff --git a/.testr.conf b/.testr.conf new file mode 100644 index 0000000..2109af6 --- /dev/null +++ b/.testr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${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 27d2986..11c7201 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,11 +1,3 @@ -[nosetests] -cover-package = openstackclient -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 df9feff..fe0c2eb 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,6 @@ setuptools.setup( install_requires=requires, dependency_links=dependency_links, cmdclass=setup.get_cmdclass(), - test_suite="nose.collector", entry_points={ 'console_scripts': ['openstack=openstackclient.shell:main'], 'openstack.cli': [ diff --git a/tox.ini b/tox.ini index f562534..6b4a96d 100644 --- a/tox.ini +++ b/tox.ini @@ -3,14 +3,12 @@ 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 + LANG=en_US.UTF-8 + LANGUAGE=en_US:en + LC_ALL=C deps = -r{toxinidir}/tools/pip-requires -r{toxinidir}/tools/test-requires -commands = nosetests +commands = python setup.py testr --testr-args='{posargs}' [testenv:pep8] deps = pep8==1.1 @@ -20,27 +18,7 @@ commands = pep8 --repeat --show-source openstackclient setup.py commands = {posargs} [testenv:cover] -commands = nosetests --cover-erase --cover-package=openstackclient --with-xcoverage +commands = python setup.py testr --coverage --testr-args='{posargs}' [tox:jenkins] downloadcache = ~/cache/pip - -[testenv:jenkins26] -basepython = python2.6 -setenv = NOSE_WITH_XUNIT=1 -deps = file://{toxinidir}/.cache.bundle - -[testenv:jenkins27] -basepython = python2.7 -setenv = NOSE_WITH_XUNIT=1 -deps = file://{toxinidir}/.cache.bundle - -[testenv:jenkinscover] -deps = file://{toxinidir}/.cache.bundle -setenv = NOSE_WITH_XUNIT=1 -commands = nosetests --cover-erase --cover-package=openstackclient --with-xcoverage - -[testenv:jenkinsvenv] -deps = file://{toxinidir}/.cache.bundle -setenv = NOSE_WITH_XUNIT=1 -commands = {posargs}