Migrate to stestr as unit tests runner

Recent update brought os-testr 1.0.0 that already uses stestr test
runner instead of testrepository. This patch migrates those places
using testrepository to using stestr.

Inspired by the patch of the same name in openstack/ironic

Change-Id: I2c1b271550629437627f3f62b6f33e2beb2b3c4b
This commit is contained in:
John L. Villalovos 2017-09-25 14:00:05 -07:00
parent b67f9c1298
commit 0ef540fc20
4 changed files with 10 additions and 5 deletions

1
.gitignore vendored
View File

@ -10,6 +10,7 @@ devenv/*
cover cover
.coverage .coverage
coverage.xml coverage.xml
.stestr
.testrepository .testrepository
imagebuild/.image_cache imagebuild/.image_cache
imagebuild/coreos/build imagebuild/coreos/build

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${OS_TEST_PATH:-./ironic_python_agent/tests/unit}
top_dir=./

View File

@ -1,4 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./ironic_python_agent/tests} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -36,8 +36,13 @@ commands =
[testenv:cover] [testenv:cover]
setenv = VIRTUAL_ENV={envdir} setenv = VIRTUAL_ENV={envdir}
PYTHON=coverage run --source ironic_python_agent --omit='*tests*' --parallel-mode
commands = commands =
python setup.py test --coverage --coverage-package-name ironic_python_agent {posargs} coverage erase
ostestr {posargs}
coverage combine
coverage report --omit='*tests*'
coverage html -d ./cover --omit='*tests*'
[testenv:venv] [testenv:venv]
setenv = PYTHONHASHSEED=0 setenv = PYTHONHASHSEED=0