From 245ee2b7db4929b0fd6f518b091d15e639f46323 Mon Sep 17 00:00:00 2001 From: Petr Blaho Date: Tue, 9 Jul 2013 13:49:00 +0200 Subject: [PATCH 1/2] Adds .coveragerc and modify tox.ini for coverage Adds some default settings to coverage tool via .coveragerc config file Adds erase and report commands to cover env in tox.ini --- .coveragerc | 7 +++++++ tox.ini | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..37e9ce7 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = tuskarclient +omit = tuskarclient/tests/* + +[report] +ignore-errors = True diff --git a/tox.ini b/tox.ini index cc9010c..e3bf858 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,9 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --omit='tuskarclient/tests/*' --testr-args='{posargs}' +commands = coverage erase + python setup.py testr --coverage --omit='tuskarclient/tests/*' --testr-args='{posargs}' + coverage report -m [tox:jenkins] downloadcache = ~/cache/pip From 81173e7e55b2207e8776282c18f022a8d0e80e82 Mon Sep 17 00:00:00 2001 From: Petr Blaho Date: Tue, 9 Jul 2013 14:09:17 +0200 Subject: [PATCH 2/2] Adds coveralls.io config Adds coveralls to test-requirements.txt Adds coveralls to after_success section in .travis.yml Adds coveralls badge to README.rst --- .travis.yml | 4 +++- README.rst | 2 ++ test-requirements.txt | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c48ffd4..8292666 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,4 +5,6 @@ install: - pip install -q -r requirements.txt --use-mirrors - pip install -q -r test-requirements.txt --use-mirrors script: - - python setup.py testr + - python setup.py testr --coverage +after_success: + - coveralls diff --git a/README.rst b/README.rst index 7a446e3..881b816 100644 --- a/README.rst +++ b/README.rst @@ -1,2 +1,4 @@ .. image:: https://travis-ci.org/jistr/python-tuskarclient.png?branch=master :target: http://travis-ci.org/jistr/python-tuskarclient +.. image:: https://coveralls.io/repos/jistr/python-tuskarclient/badge.png + :target: https://coveralls.io/r/jistr/python-tuskarclient diff --git a/test-requirements.txt b/test-requirements.txt index efba0f4..d6e1b81 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,3 +11,6 @@ mock sphinx>=1.1.2 testrepository>=0.0.13 testtools>=0.9.26 + +# for coveralls.io web service +coveralls