Skip to content

Commit

Permalink
Add code coverage report via codecov.io
Browse files Browse the repository at this point in the history
  • Loading branch information
sunu committed Aug 21, 2015
1 parent 728bb42 commit f793d14
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[run]
branch = true
include = splash/*
omit =
splash/tests/*
splash/vendor/*
splash/kernel/*
splash/conftest.py
splash/defaults.py
splash/sentry.py
splash/xvfb.py
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ virtualenv:

before_install:
- sudo apt-get install python-twisted python-qt4 lua5.2-dev zlib1g-dev python-imaging
- pip install qt4reactor psutil requests jsonschema strict-rfc3339 xvfbwrapper pytest funcparserlib
- pip install -U qt4reactor psutil requests jsonschema strict-rfc3339 xvfbwrapper pytest funcparserlib pytest-cov codecov
- "if [[ $SYSTEM_PACKAGES == 'false' ]]; then pip install -UI Pillow twisted service_identity lupa; fi"

install:
- python setup.py install

script:
- py.test --doctest-modules splash
- py.test --cov=splash --doctest-modules splash

after_success:
- codecov
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Splash - A javascript rendering service
:alt: Build Status
:target: https://travis-ci.org/scrapinghub/splash

.. image:: https://img.shields.io/codecov/c/github/scrapinghub/splash/master.svg
:alt: Coverage report
:target: http://codecov.io/github/scrapinghub/splash?branch=master

.. image:: https://img.shields.io/badge/GITTER-join%20chat-green.svg
:alt: Join the chat at https://gitter.im/scrapinghub/splash
:target: https://gitter.im/scrapinghub/splash
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ pyOpenSSL
requests >= 1.0
jsonschema >= 2.0
strict-rfc3339
pytest-cov
10 changes: 6 additions & 4 deletions splash/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys, os, time, tempfile, shutil, socket, fcntl
import sys, os, time, tempfile, shutil, socket, fcntl, signal
from subprocess import Popen, PIPE


Expand Down Expand Up @@ -85,9 +85,11 @@ def __enter__(self):
return self

def __exit__(self, exc_type, exc_value, traceback):
self.proc.kill()
self.proc.wait()
shutil.rmtree(self.tempdir)
if self.proc is not None:
self.proc.send_signal(signal.SIGINT)
self.proc.wait()
self.proc = None
shutil.rmtree(self.tempdir)

def url(self, path):
return "http://localhost:%s/%s" % (self.portnum, path.lstrip('/'))
Expand Down

0 comments on commit f793d14

Please sign in to comment.