Skip to content

Commit

Permalink
Enable coverage with tox
Browse files Browse the repository at this point in the history
  • Loading branch information
hugonicodemos committed Dec 13, 2017
1 parent c8a6238 commit 57de131
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 7 deletions.
11 changes: 9 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
[run]
omit = *test*
[paths]
source =
ironic_oneviewd

[report]
include =
ironic_oneviewd/*
omit =
*/tests/*
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ matrix:
- python: 2.7
env: TOXENV=py27
- python: 3.5-dev
env: TOXENV=py35
env: TOXENV=py35,coveralls
- python: 3.5
env: TOXENV=pylint,pep8
before_install:
- uname -a
install:
- pip install -U setuptools
- pip install tox coveralls
- pip install tox coveralls coverage
- virtualenv --version
- tox --version
script:
script:
- tox -e $TOXENV
after_success:
- coveralls
20 changes: 18 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
minversion = 1.8
envlist = py27,py35,pep8,pylint
envlist = py27,py35,pep8,pylint,cover
skip_missing_interpreters = true

[testenv]
Expand All @@ -10,6 +10,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONDONTWRITEBYTECODE = 1
LANGUAGE=en_US
LC_ALL=en_US.UTF-8
COVERAGE_FILE = {toxinidir}/.coverage.{envname}
deps = -r{toxinidir}/test-requirements.txt
commands = ostestr {posargs}

Expand All @@ -32,6 +33,21 @@ setenv = VIRTUAL_ENV={envdir}
whitelist_externals = py.test
commands = py.test --cov ./ironic_oneviewd --cov-report term-missing --cov-report xml

[testenv:coveralls]
setenv =
COVERAGE_FILE = {toxinidir}/.coverage
passenv =
*
deps =
coverage
coveralls
skip_install = true
commands =
python {envsitepackagesdir}/coverage combine
python {envsitepackagesdir}/coverage report --rcfile={toxinidir}/.coveragerc -m
- coveralls --rcfile={toxinidir}/.coveragerc
changedir = {toxinidir}

[testenv:pylint]
deps = pylint
# C0111: Missing docstring
Expand All @@ -45,4 +61,4 @@ commands = pylint -f parseable -d C0111,C0103,W0703,E1101 ironic_oneviewd --igno
show-source = True
ignore = E123,E125,E129
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

0 comments on commit 57de131

Please sign in to comment.