Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Report combined coverage to codecov #4225

Merged
merged 3 commits into from
Nov 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,24 @@ matrix:
env: TOX_ENV="pep8,check_isort"

- python: 2.7
env: TOX_ENV=py27 TRIAL_FLAGS="-j 2"
env: TOX_ENV=py27,codecov TRIAL_FLAGS="-j 2"

- python: 2.7
env: TOX_ENV=py27-old TRIAL_FLAGS="-j 2"

- python: 2.7
env: TOX_ENV=py27-postgres TRIAL_FLAGS="-j 4"
env: TOX_ENV=py27-postgres,codecov TRIAL_FLAGS="-j 4"
services:
- postgresql

- python: 3.5
env: TOX_ENV=py35 TRIAL_FLAGS="-j 2"
env: TOX_ENV=py35,codecov TRIAL_FLAGS="-j 2"

- python: 3.6
env: TOX_ENV=py36 TRIAL_FLAGS="-j 2"
env: TOX_ENV=py36,codecov TRIAL_FLAGS="-j 2"

- python: 3.6
env: TOX_ENV=py36-postgres TRIAL_FLAGS="-j 4"
env: TOX_ENV=py36-postgres,codecov TRIAL_FLAGS="-j 4"
services:
- postgresql

Expand Down
1 change: 1 addition & 0 deletions changelog.d/4225.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added automated coverage reporting to CI.
29 changes: 17 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ deps =
mock
python-subunit
junitxml
coverage

# needed by some of the tests
lxml
Expand All @@ -27,19 +28,25 @@ deps =

setenv =
PYTHONDONTWRITEBYTECODE = no_byte_code
COVERAGE_PROCESS_START = {toxinidir}/.coveragerc

[testenv]
deps =
{[base]deps}

whitelist_externals =
sh

setenv =
{[base]setenv}

passenv = *

commands =
/usr/bin/find "{toxinidir}" -name '*.pyc' -delete
"{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
# Add this so that coverage will run on subprocesses
sh -c 'echo "import coverage; coverage.process_startup()" > {envsitepackagesdir}/../sitecustomize.py'
{envbindir}/coverage run "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}

[testenv:py27]

Expand Down Expand Up @@ -101,17 +108,6 @@ usedevelop=true
[testenv:py36]
usedevelop=true


[testenv:py36-coverage]
usedevelop=true
deps =
{[base]deps}
coverage
commands =
/usr/bin/find "{toxinidir}" -name '*.pyc' -delete
python -m coverage run -m twisted.trial {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}


[testenv:py36-postgres]
usedevelop=true
deps =
Expand Down Expand Up @@ -146,3 +142,12 @@ deps = towncrier>=18.6.0rc1
commands =
python -m towncrier.check --compare-with=origin/develop
basepython = python3.6

[testenv:codecov]
skip_install = True
deps =
coverage
codecov
commands =
coverage combine
codecov -X gcov