diff --git a/.gitignore b/.gitignore index 3a64ce30..72f96514 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml +.stestr/ cover # Translations @@ -35,8 +35,6 @@ cover AUTHORS ChangeLog -.testrepository - # generated policy file etc/blazar/policy.yaml.sample diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..604900fb --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TEST_PATH:-./blazar/tests} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 4da4d7db..00000000 --- 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 $DISCOVER_DIRECTORY $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/blazar/tests/__init__.py b/blazar/tests/__init__.py index ad2e15e1..f9cb329f 100644 --- a/blazar/tests/__init__.py +++ b/blazar/tests/__init__.py @@ -17,10 +17,10 @@ import fixtures import tempfile import testscenarios -from oslo_config import cfg from oslo_log import log as logging from oslotest import base +from blazar import config as cfg from blazar import context from blazar.db.sqlalchemy import api as db_api from blazar.db.sqlalchemy import facade_wrapper diff --git a/lower-constraints.txt b/lower-constraints.txt index 27634cd8..cb91e9d8 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -100,7 +100,7 @@ statsd==3.2.2 stevedore==1.20.0 Tempita==0.5.2 tenacity==4.9.0 -testrepository==0.0.18 +stestr==2.0.0 testresources==2.0.1 testscenarios==0.4 testtools==2.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 08c90830..f0696ad5 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0 ddt>=1.0.1 # MIT fixtures>=3.0.0 # Apache-2.0/BSD -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 coverage!=4.4,>=4.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index eedcad03..aeee4331 100644 --- a/tox.ini +++ b/tox.ini @@ -16,7 +16,7 @@ setenv = VIRTUAL_ENV={envdir} DISCOVER_DIRECTORY=blazar/tests PYTHONHASHSEED=0 commands = - lockutils-wrapper python setup.py testr --slowest --testr-args="{posargs}" + stestr run --slowest {posargs} sitepackages = False @@ -25,12 +25,12 @@ setenv = {[testenv]setenv} PYTHON=coverage run --source blazar --parallel-mode commands = - coverage erase - lockutils-wrapper python setup.py testr --testr-args="{posargs}" - coverage combine - coverage html -d cover - coverage xml -o cover/coverage.xml - coverage report + coverage erase + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:pep8] commands = flake8 {posargs}