Switch to stestr

Use stestr for tests.

Also clean tox.ini and add check for flake8 H106:
Don't put vim configuration in source files.

Change-Id: Ia76961a091688372c6df363d5e1dcb29ff0f39bf
This commit is contained in:
Riccardo Pittau 2020-03-11 12:41:48 +01:00
parent 19b9f685b5
commit db3d46a7d3
5 changed files with 25 additions and 15 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ pip-log.txt
nosetests.xml
.testrepository
.venv
.stestr
# Translations
*.mo

3
.stestr.conf Normal file
View File

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

View File

@ -66,6 +66,7 @@ snowballstemmer==1.2.1
Sphinx==1.6.5
sphinxcontrib-websupport==1.0.1
sphinxcontrib-svg2pdfconverter==0.1.0
stestr==2.0.0
stevedore==1.28.0
testrepository==0.0.18
testscenarios==0.4

View File

@ -7,6 +7,7 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
doc8>=0.6.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testscenarios>=0.4 # Apache-2.0/BSD
testtools>=2.2.0 # MIT

34
tox.ini
View File

@ -5,25 +5,25 @@ skipsdist = True
ignore_basepython_conflict=true
[testenv]
usedevelop = True
install_command = pip install -U -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
basepython = python3
usedevelop = True
install_command = pip install -U {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
[testenv:pep8]
commands = flake8
doc8 doc/source releasenotes/source README.rst CONTRIBUTING.rst MISSION.rst HACKING.rst
commands =
flake8 {posargs}
doc8 doc/source releasenotes/source README.rst CONTRIBUTING.rst MISSION.rst HACKING.rst
[testenv:venv]
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/doc/requirements.txt
commands = {posargs}
[testenv:cover]
@ -39,8 +39,9 @@ commands = sphinx-build -W -b html doc/source doc/build/html
[testenv:pdf-docs]
whitelist_externals = make
deps = {[testenv:docs]deps}
commands = sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:debug]
commands = oslo_debug_helper -t bifrost/tests {posargs}
@ -49,7 +50,8 @@ commands = oslo_debug_helper -t bifrost/tests {posargs}
deps =
-c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
commands =
sphinx-build -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:debug-py36]
basepython = python3.6
@ -58,6 +60,8 @@ commands = oslo_debug_helper -t bifrost/tests {posargs}
[flake8]
show-source = True
ignore = F403,H102,H303
# [H106] Don't put vim configuration in source files.
enable-extensions=H106
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,os_ironic.py,os_ironic_node.py,os_ironic_inspect.py,os_keystone_service.py
[testenv:lower-constraints]