Skip to content

Commit

Permalink
Add test coverage computation and coveralls support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed Apr 6, 2018
1 parent dc14266 commit eec4d7c
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
branch = True
source = src

[report]
precision = 2
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
*.egg-info
*.py?
.Python
.coverage
.coverage.*
.installed*.cfg
.mr.developer.cfg
.tox
/bin/
/build/
/develop/
/develop-eggs/
/develop/
/dist/
/docs/.build/
/docs/_build/
/eggs/
/etc/
/htmlcov/
/include/
/lib/
/log/
/parts/
/var/
/docs/_build/
/docs/.build/
coverage.xml
pip-selfcheck.json
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ install:
- pip install -U setuptools==`grep setuptools versions.cfg | awk '{print $3}'`
- pip install six==`grep '^six' versions-prod.cfg | awk '{print $3}'`
- pip install zc.buildout==`grep '^zc.buildout' versions.cfg | awk '{print $3}'`
- pip install coveralls coverage
- buildout bootstrap
- buildout install test alltests
script:
- bin/alltests -v
- coverage run bin/alltests -v
after_success:
- coveralls
# Bails out for non-tags
- ./update_index.sh
notifications:
Expand Down
20 changes: 18 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
[tox]
envlist = py27,py34,py35,py36
envlist = py27,py34,py35,py36,coverage-report

[testenv]
commands =
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} bootstrap
{envbindir}/buildout -c {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test alltests
{envbindir}/alltests []
coverage run {envbindir}/alltests []
skip_install = true
deps =
coverage
setuptools==33.1.1
zc.buildout
setenv =
COVERAGE_FILE=.coverage.{envname}

[testenv:coverage-report]
basepython = python3.6
deps = coverage
setenv =
COVERAGE_FILE=.coverage
skip_install = true
commands =
coverage erase
coverage combine
coverage html -i
coverage xml -i
coverage report -i --fail-under=79

0 comments on commit eec4d7c

Please sign in to comment.