diff --git a/.gitignore b/.gitignore index 99430d0..7d7f925 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ pip-log.txt .idea cover nosetests.xml -.testrepository +.stestr/ # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..eb9d82b --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./solumclient/tests} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index fb62267..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 \ No newline at end of file diff --git a/coverage.sh b/coverage.sh deleted file mode 100755 index 8801f3f..0000000 --- a/coverage.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh -args= -if [ -n "$@" ] ; then - args="-t $@" -fi -python setup.py testr --coverage --slowest "$args" -python -m coverage report --show-missing -echo "Coverage generated, see cover/index.html" diff --git a/lower-constraints.txt b/lower-constraints.txt index 3532814..a02757f 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -43,8 +43,8 @@ requests==2.14.2 requestsexceptions==1.2.0 rfc3986==0.3.1 six==1.10.0 +stestr==2.0.0 stevedore==1.20.0 -testrepository==0.0.18 testscenarios==0.4 testtools==2.2.0 traceback2==1.4.0 diff --git a/requirements.txt b/requirements.txt index 46b098b..0b1f861 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,4 +15,4 @@ python-keystoneclient>=3.8.0 # Apache-2.0 PyYAML>=3.12 # MIT stevedore>=1.20.0 # Apache-2.0 six>=1.10.0 # MIT -PrettyTable<0.8,>=0.7.1 # BSD +PrettyTable<0.8,>=0.7.2 # BSD diff --git a/test-requirements.txt b/test-requirements.txt index 4c31bfe..6fc72cd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT mock>=2.0.0 # BSD diff --git a/tox.ini b/tox.ini index 362a920..b8eca71 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ skipsdist = True [testenv] usedevelop = True install_command = pip install {opts} {packages} +setenv = VIRTUAL_ENV={envdir} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt @@ -14,7 +15,7 @@ whitelist_externals = find commands = find . -type f -name "*.py[c|o]" -delete find . -type d -name "__pycache__" -delete - python setup.py testr --slowest --testr-args='{posargs}' + stestr run {posargs} [testenv:pypy] basepython = python3 @@ -34,7 +35,14 @@ commands = {posargs} [testenv:cover] basepython = python3 -commands = ./coverage.sh {posargs} +setenv = + {[testenv]setenv} + PYTHON=coverage run --source solumclient --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:debug] basepython = python3