From e2dd407c76d02dbc8f89c6de1daec7e6b93c7507 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Wed, 10 Feb 2021 14:53:47 +0000 Subject: [PATCH] Migrate from testr to stestr Signed-off-by: Stephen Finucane Change-Id: I9dd3a3db55fdd01d46cb7a204be46f7c5f260c4e --- .gitignore | 27 +-------------------------- .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 4 +--- tox.ini | 31 +++++++++++++++++++++++++------ 5 files changed, 30 insertions(+), 42 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 2dbc299..0111c43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,5 @@ *.py[cod] -# C extensions -*.so - # Packages *.egg *.egg-info @@ -18,30 +15,12 @@ develop-eggs lib lib64 -# Installer logs -pip-log.txt - # Unit test / coverage reports .coverage cover .tox -nosetests.xml .testrepository - -# Translations -*.mo - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject - -#IntelJ Idea -.idea/ - -# Complexity -output/*.html -output/*/index.html +.stestr # Sphinx doc/build @@ -50,9 +29,5 @@ doc/build AUTHORS ChangeLog -# Editors -*~ -.*.swp - # Files created by releasenotes build releasenotes/build diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..be08b57 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./yaql/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 182f31e..7d92711 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,7 +2,5 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0 coverage>=3.6 fixtures>=1.3.1 -python-subunit>=0.0.18 -testrepository>=0.0.18 -testscenarios>=0.4 testtools>=1.4.0 +stestr>=2.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 5dcb76f..32ff465 100644 --- a/tox.ini +++ b/tox.ini @@ -7,9 +7,19 @@ ignore_basepython_conflict = True [testenv] basepython = python3 usedevelop = True -deps = -r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +setenv = + LANGUAGE=en_US + LC_ALL=en_US.utf-8 + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 + PYTHONDONTWRITEBYTECODE=1 +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt +commands = + stestr run {posargs} + stestr slowest [testenv:pep8] commands = flake8 @@ -18,14 +28,23 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source yaql --parallel-mode +commands = + coverage erase + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:docs] deps = -r{toxinidir}/doc/requirements.txt -commands = sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html +commands = sphinx-build -a -E -W -b html doc/source doc/build/html [testenv:releasenotes] -commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html +commands = sphinx-build -a -E -b html releasenotes/source releasenotes/build/html [flake8] # H803 skipped on purpose per list discussion.