Use stestr as a test runner in tox

This commit makes stackviz use stestr as a test runner in tox.

Change-Id: Ic9e2f21fa91d9375e2020506f08ecece16706f07
This commit is contained in:
Masayuki Igawa 2019-05-01 15:15:16 -06:00
parent 906cb6b809
commit cf87b63aec
No known key found for this signature in database
GPG Key ID: 290F53EDC899BF89
4 changed files with 15 additions and 11 deletions

2
.gitignore vendored
View File

@ -34,7 +34,7 @@ cover/
!.coveragerc !.coveragerc
.tox .tox
nosetests.xml nosetests.xml
.testrepository .stestr/
.venv .venv
# Translations # Translations

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./stackviz/tests
group_regex=([^\.]*\.)*

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 ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

14
tox.ini
View File

@ -4,12 +4,20 @@ envlist = py36,py37,py27,pypy,pep8
skipsdist = True skipsdist = True
[testenv] [testenv]
setenv =
VIRTUAL_ENV={envdir}
OS_LOG_CAPTURE=1
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=160
passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY ZUUL_CACHE_DIR REQUIREMENTS_PIP_LOCATION
usedevelop = True usedevelop = True
install_command = pip install -U {opts} {packages} install_command = pip install -U {opts} {packages}
setenv = whitelist_externals = *
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/test-requirements.txt deps = -r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}' commands =
find . -type f -name "*.pyc" -delete
stestr --test-path ./stackviz/tests run {posargs}
[testenv:pep8] [testenv:pep8]
basepython = python3 basepython = python3