diff --git a/.gitignore b/.gitignore index 5659ad88a..92ed3d3ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,5 @@ -.coverage -coverage.xml -cover/* doc/source/developer/api/ -*~ -.testrepository -*.sw? -#*# *.pyc -.tox -*.egg -*.egg-info -*.eggs -dist *.qcow2 *.raw *.initrd @@ -19,9 +7,30 @@ dist /*-manifests /*.d !/.zuul.d -build -AUTHORS -ChangeLog -bin/diskimage_builder *.bak *.orig + +# Packages +*.egg* +*.egg-info +dist +build +eggs +bin/diskimage_builder + +# Unit test / coverage reports +cover/ +.coverage* +coverage.xml +!.coveragerc +.tox +.stestr/ +.venv + +# pbr generates these +AUTHORS +ChangeLog + +# Editors +*~ +*.sw? \ No newline at end of file diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..064acef8e --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=./diskimage_builder/ +group_regex=diskimage_builder.(tests|elements|block_device) +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index f2d50751c..000000000 --- a/.testr.conf +++ /dev/null @@ -1,10 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - OS_DEBUG=${OS_DEBUG:-1} \ - ${PYTHON:-python} -m subunit.run discover . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list - diff --git a/lower-constraints.txt b/lower-constraints.txt index 86f834a7f..ebfc4b397 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -39,7 +39,7 @@ snowballstemmer==1.2.1 Sphinx==1.6.2 sphinxcontrib-websupport==1.0.1 stevedore==1.20.0 -testrepository==0.0.18 +stestr==2.0.0 testtools==2.2.0 traceback2==1.4.0 unittest2==1.1.0 diff --git a/test-requirements.txt b/test-requirements.txt index a719c94f5..6ffd7c437 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,7 @@ pylint>=1.7.1 #GPLv2 fixtures>=3.0.0 # Apache-2.0/BSD mock>=2.0.0 # BSD oslotest>=3.2.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT coverage!=4.4,>=4.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 66b74c778..09e157139 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] -envlist = pep8,pylint,py35,py36,py37,py38 -minversion = 3.2.1 +envlist = pep8,pylint,py3 +minversion = 3.18.0 skipsdist = True ignore_basepython_conflict = True @@ -11,8 +11,7 @@ deps= -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands= - python setup.py test --slowest --testr-args='{posargs}' +commands= stestr run --slowest {posargs} passenv= DUMP_CONFIG_GRAPH @@ -36,11 +35,18 @@ envdir = {toxworkdir}/venv commands = {toxinidir}/tests/run_functests.sh {posargs} [testenv:cover] -# NOTE: this is "setup.py test" (*not* testr) which is a pbr wrapper -# around testr. This understands --coverage-package-name which we -# need due to underscore issues. basepython = python3 -commands = python setup.py test --coverage --coverage-package-name diskimage_builder --testr-args='{posargs}' +allowlist_externals = find +setenv = + PYTHON=coverage run --source diskimage_builder --parallel-mode +commands = + coverage erase + find . -type f -name "*.pyc" -delete + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:docs] deps= @@ -48,7 +54,7 @@ deps= -r{toxinidir}/test-requirements.txt -r{toxinidir}/doc/requirements.txt basepython = python3 -whitelist_externals = +allowlist_externals = rm commands = rm -rf doc/build