Skip to content

Commit

Permalink
Add coverage reporting via codecov (jpadilla#382)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed authored Sep 28, 2017
1 parent 6b01b47 commit 38897e7
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 71 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[run]
branch = true
source = rest_framework_jwt,tests
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ include/
lib/
local/

!.coveragerc
!.gitignore
!.travis.yml
125 changes: 67 additions & 58 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,133 +6,142 @@ matrix:
fast_finish: true
include:
- python: 2.7
env: TOX_ENV=py27-flake8
env: TOXENV=py27-flake8
- python: 2.7
env: TOX_ENV=py27-docs
env: TOXENV=py27-docs

- python: 2.7
env: TOX_ENV=py27-django1.8-drf3.1
env: TOXENV=py27-dj18-drf31-codecov
- python: 2.7
env: TOX_ENV=py27-django1.8-drf3.2
env: TOXENV=py27-dj18-drf32-codecov
- python: 2.7
env: TOX_ENV=py27-django1.8-drf3.3
env: TOXENV=py27-dj18-drf33-codecov
- python: 2.7
env: TOX_ENV=py27-django1.8-drf3.4
env: TOXENV=py27-dj18-drf34-codecov
- python: 2.7
env: TOX_ENV=py27-django1.8-drf3.5
env: TOXENV=py27-dj18-drf35-codecov
- python: 2.7
env: TOX_ENV=py27-django1.8-drf3.6
env: TOXENV=py27-dj18-drf36-codecov

- python: 2.7
env: TOX_ENV=py27-django1.9-drf3.1
env: TOXENV=py27-dj19-drf31-codecov
- python: 2.7
env: TOX_ENV=py27-django1.9-drf3.2
env: TOXENV=py27-dj19-drf32-codecov
- python: 2.7
env: TOX_ENV=py27-django1.9-drf3.3
env: TOXENV=py27-dj19-drf33-codecov
- python: 2.7
env: TOX_ENV=py27-django1.9-drf3.4
env: TOXENV=py27-dj19-drf34-codecov
- python: 2.7
env: TOX_ENV=py27-django1.9-drf3.5
env: TOXENV=py27-dj19-drf35-codecov
- python: 2.7
env: TOX_ENV=py27-django1.9-drf3.6
env: TOXENV=py27-dj19-drf36-codecov

- python: 2.7
env: TOX_ENV=py27-django1.10-drf3.4
env: TOXENV=py27-dj110-drf34-codecov
- python: 2.7
env: TOX_ENV=py27-django1.10-drf3.5
env: TOXENV=py27-dj110-drf35-codecov
- python: 2.7
env: TOX_ENV=py27-django1.10-drf3.6
env: TOXENV=py27-dj110-drf36-codecov

- python: 2.7
env: TOX_ENV=py27-django1.11-drf3.4
env: TOXENV=py27-dj111-drf34-codecov
- python: 2.7
env: TOX_ENV=py27-django1.11-drf3.5
env: TOXENV=py27-dj111-drf35-codecov
- python: 2.7
env: TOX_ENV=py27-django1.11-drf3.6
env: TOXENV=py27-dj111-drf36-codecov

- python: 3.3
env: TOX_ENV=py33-django1.8-drf3.1
env: TOXENV=py33-dj18-drf31-codecov
- python: 3.3
env: TOX_ENV=py33-django1.8-drf3.2
env: TOXENV=py33-dj18-drf32-codecov
- python: 3.3
env: TOX_ENV=py33-django1.8-drf3.3
env: TOXENV=py33-dj18-drf33-codecov
- python: 3.3
env: TOX_ENV=py33-django1.8-drf3.4
env: TOXENV=py33-dj18-drf34-codecov
- python: 3.3
env: TOX_ENV=py33-django1.8-drf3.5
env: TOXENV=py33-dj18-drf35-codecov
- python: 3.3
env: TOX_ENV=py33-django1.8-drf3.6
env: TOXENV=py33-dj18-drf36-codecov

- python: 3.4
env: TOX_ENV=py34-django1.8-drf3.1
env: TOXENV=py34-dj18-drf31-codecov
- python: 3.4
env: TOX_ENV=py34-django1.8-drf3.2
env: TOXENV=py34-dj18-drf32-codecov
- python: 3.4
env: TOX_ENV=py34-django1.8-drf3.3
env: TOXENV=py34-dj18-drf33-codecov
- python: 3.4
env: TOX_ENV=py34-django1.8-drf3.4
env: TOXENV=py34-dj18-drf34-codecov
- python: 3.4
env: TOX_ENV=py34-django1.8-drf3.5
env: TOXENV=py34-dj18-drf35-codecov
- python: 3.4
env: TOX_ENV=py34-django1.8-drf3.6
env: TOXENV=py34-dj18-drf36-codecov

- python: 3.4
env: TOX_ENV=py34-django1.9-drf3.1
env: TOXENV=py34-dj19-drf31-codecov
- python: 3.4
env: TOX_ENV=py34-django1.9-drf3.2
env: TOXENV=py34-dj19-drf32-codecov
- python: 3.4
env: TOX_ENV=py34-django1.9-drf3.3
env: TOXENV=py34-dj19-drf33-codecov
- python: 3.4
env: TOX_ENV=py34-django1.9-drf3.4
env: TOXENV=py34-dj19-drf34-codecov
- python: 3.4
env: TOX_ENV=py34-django1.9-drf3.5
env: TOXENV=py34-dj19-drf35-codecov
- python: 3.4
env: TOX_ENV=py34-django1.9-drf3.6
env: TOXENV=py34-dj19-drf36-codecov

- python: 3.4
env: TOX_ENV=py34-django1.10-drf3.4
env: TOXENV=py34-dj110-drf34-codecov
- python: 3.4
env: TOX_ENV=py34-django1.10-drf3.5
env: TOXENV=py34-dj110-drf35-codecov
- python: 3.4
env: TOX_ENV=py34-django1.10-drf3.6
env: TOXENV=py34-dj110-drf36-codecov

- python: 3.4
env: TOX_ENV=py34-django1.11-drf3.4
env: TOXENV=py34-dj111-drf34-codecov
- python: 3.4
env: TOX_ENV=py34-django1.11-drf3.5
env: TOXENV=py34-dj111-drf35-codecov
- python: 3.4
env: TOX_ENV=py34-django1.11-drf3.6
env: TOXENV=py34-dj111-drf36-codecov

- python: 3.5
env: TOX_ENV=py35-django1.10-drf3.4
env: TOXENV=py35-dj110-drf34-codecov
- python: 3.5
env: TOX_ENV=py35-django1.10-drf3.5
env: TOXENV=py35-dj110-drf35-codecov
- python: 3.5
env: TOX_ENV=py35-django1.10-drf3.6
env: TOXENV=py35-dj110-drf36-codecov

- python: 3.5
env: TOX_ENV=py35-django1.11-drf3.4
env: TOXENV=py35-dj111-drf34-codecov
- python: 3.5
env: TOX_ENV=py35-django1.11-drf3.5
env: TOXENV=py35-dj111-drf35-codecov
- python: 3.5
env: TOX_ENV=py35-django1.11-drf3.6
env: TOXENV=py35-dj111-drf36-codecov

- python: 3.6
env: TOX_ENV=py36-django1.10-drf3.4
env: TOXENV=py36-dj110-drf34-codecov
- python: 3.6
env: TOX_ENV=py36-django1.10-drf3.5
env: TOXENV=py36-dj110-drf35-codecov
- python: 3.6
env: TOX_ENV=py36-django1.10-drf3.6
env: TOXENV=py36-dj110-drf36-codecov

- python: 3.6
env: TOX_ENV=py36-django1.11-drf3.4
env: TOXENV=py36-dj111-drf34-codecov
- python: 3.6
env: TOX_ENV=py36-django1.11-drf3.5
env: TOXENV=py36-dj111-drf35-codecov
- python: 3.6
env: TOX_ENV=py36-django1.11-drf3.6
env: TOXENV=py36-dj111-drf36-codecov

install:
- pip install tox
- pip install tox

script:
- tox -e $TOX_ENV
- tox

after_success:
- |
if [[ "${TOXENV%-codecov}" != "$TOXENV" ]]; then
pip install codecov
flags="${TOXENV//-/ }"
flags="${flags//./}"
codecov --name $TOXENV --flags $flags
fi
31 changes: 18 additions & 13 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
[tox]
envlist =
py27-{flake8,docs},
{py27,py33,py34,py35,py36}-django{1.8,1.9,1.10,1.11}-drf{3.1,3.2,3.3,3.4,3.5,3.6}
{py27,py33,py34,py35,py36}-dj{18,19,110,111}-drf{31,32,33,34,35,36}

[testenv]
commands = ./runtests.py --fast {posargs} --verbose
commands =
{env:COVERAGE_RUN:} ./runtests.py --fast {posargs} --verbose
coverage,codecov: coverage report -m
setenv =
PYTHONDONTWRITEBYTECODE=1
codecov,coverage: COVERAGE_RUN=coverage run
deps =
django1.8: Django<1.9
django1.9: Django<1.10
django1.10: Django<1.11
django1.11: Django<1.12
drf3.1: djangorestframework<3.2
drf3.2: djangorestframework<3.3
drf3.3: djangorestframework<3.4
drf3.4: djangorestframework<3.5
drf3.5: djangorestframework<3.6
drf3.6: djangorestframework<3.7
py27-django{1.8,1.9}-drf{3.1,3.2,3.3,3.4}: djangorestframework-oauth==1.0.1
dj18: Django<1.9
dj19: Django<1.10
dj110: Django<1.11
dj111: Django<1.12
drf31: djangorestframework<3.2
drf32: djangorestframework<3.3
drf33: djangorestframework<3.4
drf34: djangorestframework<3.5
drf35: djangorestframework<3.6
drf36: djangorestframework<3.7
py27-dj{18,19}-drf{31,32,33,34}: djangorestframework-oauth==1.0.1
-rrequirements/testing.txt
coverage: coverage
codecov: codecov

[testenv:py27-flake8]
commands = ./runtests.py --lintonly
Expand Down

0 comments on commit 38897e7

Please sign in to comment.