Switch to stestr for unit tests
Moves coverage to a separate test environment and CI job. Change-Id: I94697ba41afbae194136202dfab349eb0367a125
This commit is contained in:
parent
c7b36754be
commit
d12d966218
2
.gitignore
vendored
2
.gitignore
vendored
@ -24,7 +24,7 @@ develop-eggs
|
|||||||
# Other
|
# Other
|
||||||
*.DS_Store
|
*.DS_Store
|
||||||
.idea
|
.idea
|
||||||
.testrepository
|
.stestr
|
||||||
.tox
|
.tox
|
||||||
.venv
|
.venv
|
||||||
.*.swp
|
.*.swp
|
||||||
|
2
.stestr.conf
Normal file
2
.stestr.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
test_path=./metalsmith/test
|
@ -172,6 +172,7 @@
|
|||||||
- openstack-python35-jobs
|
- openstack-python35-jobs
|
||||||
- openstack-python36-jobs
|
- openstack-python36-jobs
|
||||||
- openstack-lower-constraints-jobs
|
- openstack-lower-constraints-jobs
|
||||||
|
- openstack-cover-jobs
|
||||||
- docs-on-readthedocs
|
- docs-on-readthedocs
|
||||||
vars:
|
vars:
|
||||||
rtd_webhook_id: '37378'
|
rtd_webhook_id: '37378'
|
||||||
|
@ -54,6 +54,7 @@ requestsexceptions==1.4.0
|
|||||||
restructuredtext-lint==1.1.3
|
restructuredtext-lint==1.1.3
|
||||||
simplejson==3.15.0
|
simplejson==3.15.0
|
||||||
six==1.10.0
|
six==1.10.0
|
||||||
|
stestr==1.0.0
|
||||||
stevedore==1.28.0
|
stevedore==1.28.0
|
||||||
testtools==2.2.0
|
testtools==2.2.0
|
||||||
traceback2==1.4.0
|
traceback2==1.4.0
|
||||||
|
@ -7,5 +7,6 @@ flake8-import-order>=0.13 # LGPLv3
|
|||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
hacking>=1.0.0 # Apache-2.0
|
hacking>=1.0.0 # Apache-2.0
|
||||||
mock>=2.0 # BSD
|
mock>=2.0 # BSD
|
||||||
|
stestr>=1.0.0 # Apache-2.0
|
||||||
testtools>=2.2.0 # MIT
|
testtools>=2.2.0 # MIT
|
||||||
Pygments>=2.2.0 # BSD
|
Pygments>=2.2.0 # BSD
|
||||||
|
20
tox.ini
20
tox.ini
@ -3,16 +3,30 @@ envlist = py3,py27,pep8
|
|||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
LANGUAGE=en_US
|
||||||
|
LC_ALL=en_US.UTF-8
|
||||||
|
PYTHONWARNINGS=default::DeprecationWarning
|
||||||
|
PYTHONDONTWRITEBYTECODE=1
|
||||||
deps =
|
deps =
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||||||
-r{toxinidir}/requirements.txt
|
-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
coverage run --branch --include "metalsmith*" -m unittest discover metalsmith.test
|
stestr run {posargs}
|
||||||
coverage report -m --fail-under 90
|
|
||||||
setenv = PYTHONDONTWRITEBYTECODE=1
|
|
||||||
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
||||||
|
|
||||||
|
[testenv:cover]
|
||||||
|
basepython = python3
|
||||||
|
setenv = {[testenv]setenv}
|
||||||
|
PYTHON=coverage run --branch --source metalsmith --parallel-mode
|
||||||
|
commands =
|
||||||
|
coverage erase
|
||||||
|
stestr run {posargs}
|
||||||
|
coverage combine
|
||||||
|
coverage report -m --fail-under 90
|
||||||
|
coverage html -d ./cover --omit='*test*'
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
deps =
|
deps =
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user