From 6c611a3c61909fda411f7a79af53908ec7bef2c8 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Wed, 10 Feb 2021 10:30:29 +0000 Subject: [PATCH] Migrate from testr to stestr Change-Id: I735638f91617d2e951c3ec23498c8ac116cf8f08 --- .gitignore | 3 ++- .stestr.conf | 3 +++ .testr.conf | 8 -------- test-requirements.txt | 2 +- tox.ini | 17 +++++++++++------ 5 files changed, 17 insertions(+), 16 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index a9b7fc0..4c65372 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ .stestr .unit-state.db **/__pycache__/ - +.coverage +cover/ diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..5fcccac --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./unit_tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 801646b..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:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ./unit_tests $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index 3bd9898..6da7df2 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ # Lint and unit test requirements flake8 -os-testr>=0.4.1 +stestr>=2.2.0 charms.reactive coverage>=3.6 netifaces diff --git a/tox.ini b/tox.ini index f350fd1..defb8d1 100644 --- a/tox.ini +++ b/tox.ini @@ -11,27 +11,32 @@ setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 install_command = pip install {opts} {packages} -commands = ostestr {posargs} +commands = stestr run {posargs} [testenv:py34] basepython = python3.4 deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} +commands = stestr run {posargs} [testenv:py35] basepython = python3.5 deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} +commands = stestr run {posargs} [testenv:py36] basepython = python3.6 deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} +commands = stestr run {posargs} [testenv:py37] basepython = python3.7 deps = -r{toxinidir}/test-requirements.txt -commands = ostestr {posargs} +commands = stestr run {posargs} + +[testenv:py3] +basepython = python3 +deps = -r{toxinidir}/test-requirements.txt +commands = stestr run {posargs} [testenv:pep8] basepython = python3 @@ -48,7 +53,7 @@ setenv = PYTHON=coverage run commands = coverage erase - ostestr {posargs} + stestr run {posargs} coverage combine coverage html -d cover coverage xml -o cover/coverage.xml