Switch to stestr

According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Ic328c6d6f47fabd3a9b8c013e60dfd44e9d38ac1
This commit is contained in:
Vu Cong Tuan 2018-07-10 10:13:46 +07:00
parent f82d74ff1a
commit ce3f8b7fc1
5 changed files with 14 additions and 17 deletions

3
.gitignore vendored
View File

@ -24,8 +24,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
.testrepository
.stestr/
.venv
# Translations

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./compute_hyperv/tests/unit
top_dir=./

View File

@ -1,8 +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:-160} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./hyperv/tests} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -10,7 +10,7 @@ python-subunit>=1.0.0 # Apache-2.0/BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
oslo.config>=5.2.0 # Apache-2.0
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
openstackdocstheme>=1.18.1 # Apache-2.0

15
tox.ini
View File

@ -20,7 +20,7 @@ deps = -r{toxinidir}/requirements.txt
-egit+https://github.com/openstack/nova#egg=nova
commands =
find . -type f -name "*.pyc" -delete
python setup.py testr --slowest --testr-args='{posargs}'
stestr run --slowest {posargs}
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
@ -31,12 +31,15 @@ commands =
[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv =
PYTHON=coverage run --source compute_hyperv --parallel-mode
commands =
coverage erase
python setup.py testr --coverage \
--testr-args='{posargs}'
coverage combine
coverage html --include='compute_hyperv/*' --omit='compute_hyperv/openstack/common/*' -d covhtml -i
coverage erase
stestr run '{posargs}'
coverage combine
coverage html --include='compute_hyperv/*' --omit='compute_hyperv/openstack/common/*' -d covhtml -i
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv]
commands = {posargs}