Skip to content

Commit

Permalink
added Coveralls configuration for code coverage
Browse files Browse the repository at this point in the history
unfortunately, this proved more complex than desired - for reasons that
are not entirely clear (cf. inline comment); debugging SaaS is a pain
  • Loading branch information
FND committed Sep 7, 2013
1 parent ef499e3 commit e98c767
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,12 @@ python:
install:
- pip install --use-mirrors \
`python -c 'from setup import META; print " ".join(META["extras_require"]["testing"] + META["install_requires"])'`
- pip install coveralls
- python setup.py develop

script: make test
script:
- make remotes
- coverage run --source=tiddlywebplugins/bfw setup.py test
- coverage report -m

after_success: coveralls
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[Barely Functioning Wiki](https://github.com/FND/tiddlywebplugins.bfw)
[![build status](https://secure.travis-ci.org/FND/tiddlywebplugins.bfw.png)](http://travis-ci.org/FND/tiddlywebplugins.bfw)
[![coverage](https://coveralls.io/repos/FND/tiddlywebplugins.bfw/badge.png)](https://coveralls.io/r/FND/tiddlywebplugins.bfw)

wiki-like system for individuals and small teams, emphasizing micro-content and
based on [TiddlyWeb](http://tiddlyweb.com)
Expand Down
20 changes: 20 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import sys
import os

from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand

from tiddlywebplugins.bfw import (__version__ as VERSION, __author__ as AUTHOR,
__license__ as LICENSE, __doc__ as DESC)
Expand Down Expand Up @@ -32,5 +34,23 @@
}


# entry point for tests (required because `coverage` fails to invoke `py.test`
# in Travis CI's virtualenv)

class PyTest(TestCommand):

def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True

def run_tests(self):
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)

META['cmdclass'] = { 'test': PyTest }


if __name__ == '__main__':
setup(**META)

0 comments on commit e98c767

Please sign in to comment.