diff --git a/.gitignore b/.gitignore index 32eed501d..14f72d87c 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml -.testrepository +.stestr/ .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..615ab8a65 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./congress/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 5ebedb494..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 ./ ./congress/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/lower-constraints.txt b/lower-constraints.txt index 5a26e2cd3..32da8cb51 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -125,11 +125,11 @@ sqlalchemy-migrate==0.11.0 SQLAlchemy==1.2.5 sqlparse==0.2.4 statsd==3.2.2 +stestr==2.0.0 stevedore==1.28.0 suds-jurko==0.6 Tempita==0.5.2 tenacity==4.4.0 -testrepository==0.0.18 testresources==2.0.1 testscenarios==0.4 testtools==2.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index e51aabe83..5fc0b0e32 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,6 +10,6 @@ mox3>=0.20.0 # Apache-2.0 oslotest>=3.2.0 # Apache-2.0 requests-mock>=1.2.0 # Apache-2.0 python-subunit>=1.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 diff --git a/tox.ini b/tox.ini index ae5654f06..035c12a88 100644 --- a/tox.ini +++ b/tox.ini @@ -18,7 +18,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.py[c|o]" -delete - python setup.py testr --slowest --testr-args='{posargs} --concurrency=1' + stestr run --slowest --concurrency=1 {posargs} [testenv:pep8] basepython = python3 @@ -33,10 +33,15 @@ commands = {posargs} [testenv:cover] basepython = python3 +setenv = + PYTHON=coverage run --source congress --parallel-mode commands = coverage erase find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args='^(?!congress\.tests\.haht\.test_congress_haht.*){posargs}' + stestr run '^(?!congress\.tests\.haht\.test_congress_haht.*){posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml coverage report [testenv:debug] @@ -51,8 +56,8 @@ setenv = LANG=en_US.UTF-8 LANGUAGE=en_US LC_ALL=en_US.utf-8 -commands = python setup.py testr --testr-args='test_benchmark {posargs} --concurrency=1' - testr slowest --all +commands = stestr run --concurrency=1 'test_benchmark {posargs}' + stestr slowest --all [flake8] show-source = True