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.

Uses environment inclusions which need tox 2.8.1 due to
a bug fix. So increase the tox minversion.

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

Change-Id: If6eded0dd802cbdfe49ad72c64004585d4a1484b
This commit is contained in:
Ilya Etingof 2018-08-10 14:04:40 +02:00
parent 9e443c8135
commit 524821fa31
7 changed files with 26 additions and 16 deletions

7
.coveragerc Normal file
View File

@ -0,0 +1,7 @@
[run]
branch = True
source = pyghmi
omit = pyghmi/tests/*
[report]
ignore_errors = True

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${TESTS_DIR:-./pyghmi/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:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -2,9 +2,8 @@ coverage===4.0
cryptography===2.1
fixtures===3.0.0
oslotest===3.2.0
os-testr===1.0.0
python-subunit===1.0.0
Sphinx===1.6.5
testrepository===0.0.18
stestr==1.0.0
testscenarios===0.4
testtools===2.2.0

View File

@ -1 +1 @@
cryptography!=2.0 # BSD/Apache-2.0
cryptography>=2.1 # BSD/Apache-2.0

View File

@ -3,8 +3,7 @@ coverage>=4.0
fixtures>=3.0.0
python-subunit>=1.0.0
sphinx>=1.6.5
testrepository>=0.0.18
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4
testtools>=2.2.0
os-testr>=1.0.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0

16
tox.ini
View File

@ -1,4 +1,5 @@
[tox]
minversion = 2.8.1
envlist = py35,py27,pep8
[testenv]
@ -7,9 +8,13 @@ setenv = VIRTUAL_ENV={envdir}
LANGUAGE=en_US:en
LC_ALL=C
TESTS_DIR=./pyghmi/tests/unit/
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = ostestr {posargs}
commands = stestr run {posargs}
stestr slowest
[tox:jenkins]
sitepackages = True
@ -21,9 +26,14 @@ commands = bash -c 'pycodestyle pyghmi bin/*'
[testenv:cover]
basepython = python3
setenv = VIRTUAL_ENV={envdir}
setenv =
{[testenv]setenv}
PYTHON=coverage run --source pyghmi --parallel-mode
commands =
python setup.py testr --coverage
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:venv]
basepython = python3