From e541da94aabbe47f80ab55f9fcbb0c6ef9027fe2 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Fri, 15 Dec 2017 17:19:38 +0900 Subject: [PATCH] Switch to use stestr instead of os-testr This commit switches to use stestr instead of os-testr. It should be better to reduce the test runner complexity. Change-Id: Ia16ad5ed6d9ed7be9dc6902f875b0144b24a938a --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 2 +- tox.ini | 15 +++++++++++++-- 5 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index c934954..91e6d03 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ cover/ .tox nosetests.xml .testrepository +.stestr .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..f3ad79e --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=coverage2sql/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c..0000000 --- a/.testr.conf +++ /dev/null @@ -1,7 +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:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index c080d24..9afd64a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -14,7 +14,7 @@ testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT PyMySQL>=0.7.6 # MIT License psycopg2>=2.5 # LGPL/ZPL -os-testr>=0.8.0 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 reno>=1.8.0 # Apache-2.0 oslo.concurrency>=3.8.0 # Apache-2.0 six>=1.9.0 # MIT diff --git a/tox.ini b/tox.ini index dcae417..f0ab231 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - ostestr {posargs} + stestr run {posargs} [testenv:pep8] sitepackages = False @@ -23,7 +23,18 @@ commands = commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source coverage2sql --parallel-mode +commands = + coverage erase + find . -type f -name "*.pyc" -delete + stestr --test-path ./coverage2sql/tests run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report + [testenv:docs] commands = python setup.py build_sphinx