-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up coverage generation and reporting in tox & travis. #187
Changes from 14 commits
f78bca5
65a7344
fd0e2f9
77390bb
7aac72d
f02c021
862acc5
d44dc11
657da86
3e7d556
444b976
6bcccb1
a51e628
bc03700
39a742f
a7a1659
1583db9
586d77a
7ce96c9
c583d61
8a2ebc2
3543943
b828beb
54ef3a2
a73859b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,7 @@ | ||
*.pyc | ||
_trial_temp | ||
build | ||
htmlcov | ||
.coverage | ||
*.egg-info | ||
.tox/ | ||
docs/_build/ | ||
__pycache__ | ||
/docs/_build/ | ||
.DS_Store | ||
dist/ | ||
/src/*.egg-info | ||
/.tox/ | ||
*~ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[run] | ||
branch = True | ||
source = klein | ||
|
||
[report] | ||
precision = 2 | ||
show_missing = True |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
[tox] | ||
|
||
envlist = | ||
flake8, twistedchecker-diff | ||
flake8 | ||
|
||
# Twisted 15.5 is the first version to support Python 3 (3.3+) | ||
trial-py{27,py,34,35,36}-tw{155,166,current,trunk} | ||
coverage-py{27,py,34,35,36}-tw{155,166,current,trunk} | ||
|
||
docs, docs-linkcheck | ||
|
||
skip_missing_interpreters = True | ||
|
||
|
||
## | ||
# Default testenv | ||
# Default environment: unit tests | ||
## | ||
|
||
[testenv] | ||
|
@@ -24,10 +24,8 @@ basepython = | |
py35: python3.5 | ||
py36: python3.6 | ||
|
||
deps = | ||
coverage | ||
mock | ||
|
||
deps = | ||
tw150: Twisted==15.0 | ||
tw151: Twisted==15.1 | ||
tw152: Twisted==15.2 | ||
|
@@ -45,13 +43,45 @@ deps = | |
twcurrent: Twisted | ||
twtrunk: https://github.com/twisted/twisted/archive/trunk.zip | ||
|
||
{trial,coverage}: mock | ||
|
||
coverage: coverage | ||
|
||
|
||
passenv = | ||
PATH | ||
CI CONTINUOUS_INTEGRATION | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see anything in this changeset which references these. Are they for Hypothesis in #181? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah |
||
TRAVIS TRAVIS_* _system_* | ||
CODECOV_OPTIONS | ||
|
||
|
||
setenv = | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 | ||
|
||
coverage: COVERAGE_FILE={toxworkdir}/coverage/coverage.{envname} | ||
{coverage_combine,codecov}: COVERAGE_FILE={toxworkdir}/coverage/coverage | ||
|
||
{coverage,coverage_combine}: COVERAGE_HTML={envlogdir}/coverage_report_html | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's a directory name |
||
{coverage,coverage_combine,codecov}: COVERAGE_XML={envlogdir}/coverage_report.xml | ||
|
||
|
||
commands = | ||
"{toxinidir}/.travis/environment" | ||
coverage run -p "{envdir}/bin/trial" {posargs:klein} | ||
|
||
# Run trial without coverage | ||
trial: trial --random=0 --logfile="{envlogdir}/trial.log" --temp-directory="{envlogdir}/trial.d" {posargs:klein} | ||
|
||
coverage: python -c 'import os; d="{toxworkdir}/coverage"; os.makedirs(d) if not os.path.exists(d) else None' | ||
coverage: coverage run --rcfile="{toxinidir}/coverage.conf" "{envdir}/bin/trial" --random=0 --logfile="{envlogdir}/trial.log" --temp-directory="{envlogdir}/trial.d" {posargs:klein} | ||
|
||
coverage-html: coverage html --rcfile="{toxinidir}/coverage.conf" -d "{env:COVERAGE_HTML}" | ||
coverage-xml: coverage xml --rcfile="{toxinidir}/coverage.conf" -o "{env:COVERAGE_XML}" | ||
coverage: coverage report --rcfile="{toxinidir}/coverage.conf" --skip-covered --omit "*/test/*" | ||
|
||
|
||
|
||
## | ||
# Run flake8 | ||
# Flake8 linting | ||
## | ||
|
||
[testenv:flake8] | ||
|
@@ -71,6 +101,7 @@ basepython = python3.5 | |
|
||
commands = | ||
"{toxinidir}/.travis/environment" | ||
|
||
flake8 {posargs:src/klein} | ||
|
||
|
||
|
@@ -102,6 +133,7 @@ application-import-names = klein | |
max-complexity = 21 | ||
|
||
|
||
|
||
## | ||
# Run twistedchecker | ||
## | ||
|
@@ -114,9 +146,11 @@ basepython = python2.7 | |
|
||
commands = | ||
"{toxinidir}/.travis/environment" | ||
|
||
twistedchecker {posargs:klein} | ||
|
||
|
||
|
||
## | ||
# Run twistedchecker on changes relative to master | ||
## | ||
|
@@ -131,7 +165,58 @@ basepython = python2.7 | |
|
||
commands = | ||
"{toxinidir}/.travis/environment" | ||
{toxinidir}/.travis/twistedchecker-diff {posargs:klein} | ||
|
||
"{toxinidir}/.travis/twistedchecker-diff" {posargs:klein} | ||
|
||
|
||
|
||
## | ||
# Combine coverage reports | ||
## | ||
|
||
[testenv:coverage_combine] | ||
|
||
basepython = python3.5 | ||
|
||
skip_install = True | ||
|
||
deps = coverage | ||
|
||
|
||
commands = | ||
"{toxinidir}/.travis/environment" | ||
|
||
coverage combine --append | ||
|
||
coverage html --rcfile="{toxinidir}/coverage.conf" -d "{env:COVERAGE_HTML}" | ||
coverage xml --rcfile="{toxinidir}/coverage.conf" -o "{env:COVERAGE_XML}" | ||
|
||
coverage report --rcfile="{toxinidir}/coverage.conf" --fail-under=100 --omit "*/test/*" | ||
|
||
|
||
|
||
## | ||
# Publish to Codecov | ||
## | ||
|
||
[testenv:codecov] | ||
|
||
basepython = python3.5 | ||
|
||
skip_install = True | ||
|
||
deps = codecov | ||
|
||
|
||
commands = | ||
"{toxinidir}/.travis/environment" | ||
|
||
coverage combine --append | ||
|
||
# Generate XML and publish to codecov.io | ||
coverage xml --rcfile="{toxinidir}/coverage.conf" -o "{env:COVERAGE_XML}" | ||
codecov --required --file="{env:COVERAGE_XML}" {env:CODECOV_OPTIONS:} | ||
|
||
|
||
|
||
## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to tell which parts of this diff are spurious and which are actual change. can you keep the old order?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, it's not that big a file, and I don't think it helped that much, but re-ordered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reordered in 3e7d556