From cf87b63aece8f9dac85a67ceb8343ac1f46c50e4 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Wed, 1 May 2019 15:15:16 -0600 Subject: [PATCH] Use stestr as a test runner in tox This commit makes stackviz use stestr as a test runner in tox. Change-Id: Ic9e2f21fa91d9375e2020506f08ecece16706f07 --- .gitignore | 2 +- .stestr.conf | 3 +++ .testr.conf | 7 ------- tox.ini | 14 +++++++++++--- 4 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 66aab1d..7dabeae 100644 --- a/.gitignore +++ b/.gitignore @@ -34,7 +34,7 @@ cover/ !.coveragerc .tox nosetests.xml -.testrepository +.stestr/ .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..d35ba9c --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./stackviz/tests +group_regex=([^\.]*\.)* diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c..0000000 --- a/.testr.conf +++ /dev/null @@ -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 diff --git a/tox.ini b/tox.ini index 8b2ad1c..66235f3 100644 --- a/tox.ini +++ b/tox.ini @@ -4,12 +4,20 @@ envlist = py36,py37,py27,pypy,pep8 skipsdist = True [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 install_command = pip install -U {opts} {packages} -setenv = - VIRTUAL_ENV={envdir} +whitelist_externals = * 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] basepython = python3