Migrate from testr to stestr

Also add .zuul.yaml to allow charm to run test and merge.

Change-Id: Icac06e1de342ae52a65345e4268ecd39a7cf15f3
This commit is contained in:
Alex Kavanagh 2021-02-10 10:35:27 +00:00 committed by Alex Kavanagh
parent 663e6b741e
commit 620f9eef99
6 changed files with 21 additions and 14 deletions

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.opendev.org
port=29418
project=openstack/charm-interface-nova-cell.git

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

3
.zuul.yaml Normal file
View File

@ -0,0 +1,3 @@
- project:
templates:
- openstack-python3-charm-jobs

View File

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

15
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
skipsdist = True
envlist = pep8,py35
envlist = pep8,py36
skip_missing_interpreters = True
[testenv]
@ -11,17 +11,22 @@ install_command =
pip install {opts} {packages}
[testenv:py35]
basepython = python3
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:py3]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
[testenv:pep8]
basepython = python2.7
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
commands = flake8 {posargs} . unit_tests