Merge "Switch to use stestr for unit test"

This commit is contained in:
Zuul
2019-04-04 17:22:36 +00:00
committed by Gerrit Code Review
5 changed files with 13 additions and 11 deletions

2
.gitignore vendored
View File

@@ -26,7 +26,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
.testrepository
.stestr/
.venv
# Translations

3
.stestr.conf Normal file
View File

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

View File

@@ -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 ./ ${OS_TEST_PATH:-./aodhclient/tests} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@@ -29,7 +29,7 @@ test =
oslotest>=1.10.0 # Apache-2.0
reno>=1.6.2 # Apache2
tempest>=10
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
testtools>=1.4.0
pifpaf[gnocchi]>=0.23
gnocchi[postgresql,file]

10
tox.ini
View File

@@ -16,7 +16,7 @@ passenv = GNOCCHI_* AODH_* OS_TEST_TIMEOUT OS_STDOUT_CAPTURE OS_STDERR_CAPTURE O
deps =
.[test]
http://tarballs.openstack.org/aodh/aodh-master.tar.gz#egg=aodh[mysql]
commands = pifpaf run aodh -- python setup.py test --slowest --testr-args='{posargs}'
commands = pifpaf run aodh -- stestr run --slowest {posargs}
[testenv:pep8]
basepython = python3
@@ -31,8 +31,14 @@ commands = {posargs}
[testenv:cover]
basepython = python3
setenv =
{[testenv]setenv}
PYTHON=coverage run --source aodhclient --parallel-mode
commands =
python setup.py test --coverage --testr-args='{posargs}'
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:releasenotes]