diff --git a/.gitignore b/.gitignore index 0d2b3fe89..a033d7715 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ install-undercloud.log .tox nosetests.xml .testrepository +.stestr/* # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..b8379e251 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TEST_PATH:-./tripleoclient/tests} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index fb622677a..000000000 --- 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 \ No newline at end of file diff --git a/lower-constraints.txt b/lower-constraints.txt index 7f9b12775..661b084bd 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -138,10 +138,10 @@ sqlalchemy-migrate==0.11.0 SQLAlchemy==1.0.10 sqlparse==0.2.2 statsd==3.2.1 +stestr==2.0.0 stevedore==1.20.0 Tempita==0.5.2 tenacity==4.9.0 -testrepository==0.0.18 testscenarios===0.4 testtools==2.2.0 tooz==1.58.0 diff --git a/test-requirements.txt b/test-requirements.txt index bebddd361..db8b2a621 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,7 @@ coverage!=4.4,>=4.0 # Apache-2.0 docutils>=0.11 # OSI-Approved Open Source, Public Domain fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0.0 # BSD -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT requests-mock>=1.2.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 97ac65554..e941094d0 100644 --- a/tox.ini +++ b/tox.ini @@ -6,16 +6,19 @@ skipsdist = True [testenv] usedevelop = True install_command = pip install {opts} {packages} +passenv = + TERM setenv = VIRTUAL_ENV={envdir} LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=C + HOME={envdir} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +commands = stestr run {posargs} [testenv:bindep] basepython = python3 @@ -37,10 +40,16 @@ passenv = * [testenv:cover] basepython = python3 +setenv = + PYTHON=coverage run --source tripleoclient --parallel-mode + HOME={envdir} commands = - python setup.py testr --coverage --testr-args='{posargs}' - coverage combine - coverage report -m + coverage erase + stestr run --color {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:debug] basepython = python3