diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..e21094e --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = virtualbmc +omit = virtualbmc/tests/* + +[report] +ignore_errors = True diff --git a/.gitignore b/.gitignore index 398155f..e93cbec 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ cover .tox nosetests.xml .testrepository +.stestr .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..53b7578 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TESTS_DIR:-./virtualbmc/tests/unit/} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c..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 diff --git a/test-requirements.txt b/test-requirements.txt index d174f56..eb7f437 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -13,7 +13,7 @@ oslotest>=3.2.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT -os-testr>=1.0.0 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 mock>=2.0.0 # BSD # releasenotes diff --git a/tox.ini b/tox.ini index 32e209c..08369f4 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,9 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt -commands = ostestr {posargs} +commands = + stestr run '{posargs}' + stestr slowest passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:pep8] @@ -30,7 +32,13 @@ commands = {posargs} [testenv:cover] basepython = python3 -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = {[testenv]setenv} + PYTHON=coverage run --source virtualbmc --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] basepython = python3