Migrate unit tests from testr to stestr

Change-Id: I5c0c74fc2e212144d4d98c8b230d9ce39f45fc64
This commit is contained in:
Alex Kavanagh 2021-02-10 10:43:29 +00:00
parent ca95a73d6c
commit ea0721a6fa
5 changed files with 15 additions and 13 deletions

2
.gitignore vendored
View File

@ -3,3 +3,5 @@
.unit-state.db
.stestr/
__pycache__/
.coverage
cover/

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./unit_tests
top_dir=./

View File

@ -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

View File

@ -1,5 +1,5 @@
# Lint and unit test requirements
flake8
os-testr>=0.4.1
stestr>=2.2.0
charms.reactive
coverage>=3.6

13
tox.ini
View File

@ -16,17 +16,22 @@ install_command =
[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
@ -43,7 +48,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