diff --git a/.gitignore b/.gitignore index 2682e2a6a..c823c249c 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,6 @@ doc/source/api/ *.egg .autogenerated .coverage -.testrepository/ +.stestr/ .tox/ .idea diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..3dbded523 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./stackalytics/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6f96a86e9..000000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 ${PYTHON:-python} -m subunit.run discover -t ./ ./stackalytics/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index 0a075aac5..5e215068a 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,5 +10,5 @@ mock>=2.0 # BSD python-subunit>=0.0.18 # Apache-2.0/BSD sphinx>=1.5.1 # BSD sphinxcontrib-httpdomain # BSD -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index ac2880b2e..95cbd8e4c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,7 @@ install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:pep8] commands = flake8 @@ -18,7 +18,13 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + PYTHON=coverage run --source $project --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:genconfig] commands =