From 7dff2c14a0db6a909c8536b31208b3579d1eeb70 Mon Sep 17 00:00:00 2001 From: Craig Citro Date: Fri, 12 Dec 2014 17:13:22 -0800 Subject: [PATCH] First pass at coveralls integration. This adds `cover` and `coveralls` envs in `tox`, and a call to `coveralls` in `.travis.yml`. Settling for 60% coverage for now. --- .coveragerc | 7 +++++++ .gitignore | 5 +++++ .travis.yml | 2 ++ tox.ini | 23 ++++++++++++++++++++++- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..83429b0 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[report] +omit = */samples/* +exclude_lines = + # Re-enable the standard pragma + pragma: NO COVER + # Ignore debug-only repr + def __repr__ diff --git a/.gitignore b/.gitignore index ac20bd2..519e3f9 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,8 @@ docs/ # Test files .tox/ + +# Coverage files +.coverage +coverage.xml +nosetests.xml diff --git a/.travis.yml b/.travis.yml index a30cb68..f8e8beb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,5 +13,7 @@ install: - pip install tox script: - tox -e $TOX_ENV +after_success: + - tox -e coveralls notifications: - email: false diff --git a/tox.ini b/tox.ini index 5c48fb6..85c61ac 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,8 @@ envlist = py26openssl13, py26openssl14, py27openssl13, py27openssl14, py33openssl14, py34openssl14, - pypyopenssl13, pypyopenssl14 + pypyopenssl13, pypyopenssl14, + cover [testenv] deps = keyring @@ -58,3 +59,23 @@ deps = {[testenv]deps} [testenv:pypyopenssl14] deps = {[testenv]deps} pyopenssl==0.14 + +[testenv:cover] +basepython = + python2.7 +commands = + nosetests --with-xunit --with-xcoverage --cover-package=oauth2client --nocapture --cover-erase --cover-tests --cover-branches --ignore-files=test_appengine\.py --cover-min-percentage=60 +deps = {[testenv]deps} + coverage>=3.6,<3.99 + nosexcover + rsa + pyopenssl==0.14 + +[testenv:coveralls] +basepython = {[testenv:cover]basepython} +commands = + {[testenv:cover]commands} + coveralls +deps = + {[testenv:cover]deps} + coveralls