From b99350137b76a6f56a39a92cd464cec01f46f421 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 4 Aug 2017 15:41:57 -0400 Subject: [PATCH] Switch to using stestr stestr is a fork of testrepository, designed specifically to concentrate on being a dedicated test runner. [1] The testrepository project is basically not active anymore and has several long standing bugs and useablility issues. stestr is still actively maintained and fixes a large number of those issues with testrepository. The best part is that stestr supports using subunit2sql as a repository backend. [1] https://github.com/mtreinish/stestr Change-Id: I39f5db8f77de027c18917215c761dca69d8cbea0 --- .stestr.conf | 3 +++ .testr.conf | 8 -------- test-requirements.txt | 2 +- tox.ini | 17 +++++++++++++---- 4 files changed, 17 insertions(+), 13 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..28bdfbb --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./subunit2sql/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 87e3abe..0000000 --- a/.testr.conf +++ /dev/null @@ -1,8 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-500} \ - OS_TEST_LOCK_PATH=${OS_TEST_LOCK_PATH:-${TMPDIR:-'/tmp'}} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ./subunit2sql/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index bfadf82..334d3ca 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,7 +4,7 @@ fixtures>=0.3.14 mock>=1.0 sphinx>=1.6.2 # BSD testscenarios>=0.4 -testrepository>=0.0.18 +stestr>=1.0.0 testtools>=0.9.34 oslosphinx PyMySql diff --git a/tox.ini b/tox.ini index 1a44e86..e655761 100644 --- a/tox.ini +++ b/tox.ini @@ -6,13 +6,18 @@ skipsdist = True [testenv] usedevelop = True install_command = pip install -U --force-reinstall {opts} {packages} -setenv = VIRTUAL_ENV={envdir} +setenv = + VIRTUAL_ENV={envdir} + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=500 whitelist_externals = find deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - ostestr {posargs} + stestr run {posargs} + stestr slowest [testenv:pep8] sitepackages = False @@ -20,9 +25,13 @@ commands = flake8 {posargs} [testenv:cover] -setenv = VIRTUAL_ENV={envdir} +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source subunit2sql --parallel-mode commands = - python setup.py testr --coverage --testr-args='{posargs}' + stestr run {posargs} + coverage combine + coverage html -d cover [testenv:venv] commands = {posargs}