Add coverage computation to travis

This commit is contained in:
Valentin Samir 2016-06-29 23:48:29 +02:00
parent 2fba4183a3
commit 22a7568498
4 changed files with 19 additions and 11 deletions

View File

@ -5,13 +5,14 @@ env:
global:
- PIP_DOWNLOAD_CACHE=$HOME/.pip_cache
matrix:
- TOX_ENV=coverage
- TOX_ENV=flake8
- TOX_ENV=py27-django17
- TOX_ENV=py27-django18
- TOX_ENV=py27-django19
- TOX_ENV=py34-django17
- TOX_ENV=py34-django18
- TOX_ENV=py34-django19
- TOX_ENV=flake8
cache:
directories:
- $HOME/.pip-cache/
@ -22,4 +23,3 @@ script:
- tox -e $TOX_ENV
after_script:
- cat .tox/$TOX_ENV/log/*.log

View File

@ -47,9 +47,6 @@ test_venv/cas/manage.py: test_venv
test_venv/bin/python test_venv/cas/manage.py migrate
test_venv/bin/python test_venv/cas/manage.py createsuperuser
test_venv/bin/coverage: test_venv
test_venv/bin/pip install coverage
test_venv: test_venv/bin/python
test_project: test_venv/cas/manage.py
@ -62,12 +59,11 @@ run_test_server: test_project
tests: test_venv
test_venv/bin/py.test
coverage: test_venv/bin/coverage
test_venv/bin/coverage run test_venv/bin/py.test
test_venv/bin/coverage html
rm htmlcov/coverage_html.js # I am really pissed off by those keybord shortcuts
coverage: test_venv
test_venv/bin/py.test --cov=cas_server --cov-report xml --cov-report html
coverage_codacy: coverage
test_venv/bin/coverage xml
test_venv/bin/python-codacy-coverage:
test_venv/bin/pip install codacy-coverage
coverage_codacy: coverage test_venv/bin/python-codacy-coverage
test_venv/bin/python-codacy-coverage -r coverage.xml

View File

@ -3,6 +3,7 @@ tox>=1.8.1
pytest>=2.6.4
pytest-django>=2.8.0
pytest-pythonpath>=0.3
pytest-cov>=2.2.1
requests>=2.4
requests_futures>=0.9.5
django-picklefield>=0.3.1

11
tox.ini
View File

@ -7,6 +7,7 @@ envlist=
py34-django18,
py34-django19,
flake8,
coverage
[flake8]
max-line-length=100
@ -60,3 +61,13 @@ basepython=python
deps=flake8
commands=flake8 {toxinidir}/cas_server
[testenv:coverage]
basepython=python
passenv=CODACY_PROJECT_TOKEN
deps=
-r{toxinidir}/requirements-dev.txt
codacy-coverage
commands=
py.test --cov=cas_server --cov-report xml
python-codacy-coverage -r {toxinidir}/coverage.xml