From 2f27d04c86ecb676bd688c9134cd68a5d8f03624 Mon Sep 17 00:00:00 2001 From: jpic Date: Wed, 15 Jun 2016 21:18:03 +0200 Subject: [PATCH 1/4] Use tox for tests --- .travis.yml | 16 +++++++++++----- tox.ini | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 tox.ini diff --git a/.travis.yml b/.travis.yml index 6f34248..3327d92 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,15 @@ sudo: false language: python python: - - "2.7" - - "3.5" +- "3.5" +env: + global: + - PIP_RETRIES=10 + - PIP_TIMEOUT=30 + matrix: + - TOXENV=py27 + - TOXENV=py35 install: - - if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install unittest2; fi - - pip install asgiref twisted autobahn -script: if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then python -m unittest2; else python -m unittest; fi +- travis_retry pip install tox +script: +- tox diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e9c9bc8 --- /dev/null +++ b/tox.ini @@ -0,0 +1,18 @@ +[tox] +envlist = py{27,35} + +[testenv] +usedevelop = true +commands = + python -m unittest +deps = + asgiref + twisted + autobahn + +[testenv:py27] +commands = + python -m unittest2 +deps = + unittest2 + {[testenv]deps} From 049d6f65ae3e39ac1b1dbb02a80d4ddc00afeb51 Mon Sep 17 00:00:00 2001 From: jpic Date: Wed, 15 Jun 2016 21:44:36 +0200 Subject: [PATCH 2/4] Add coverage report --- tox.ini | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index e9c9bc8..9ef6dcf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,18 +1,25 @@ [tox] envlist = py{27,35} +[base] +commands = + coverage report -m + [testenv] usedevelop = true commands = - python -m unittest + coverage run -m unittest + {[base]commands} deps = asgiref twisted autobahn + coverage [testenv:py27] commands = - python -m unittest2 + coverage run -m unittest2 + {[base]commands} deps = unittest2 {[testenv]deps} From 2d261353d9aa7f7b48645063a229aa638be565fb Mon Sep 17 00:00:00 2001 From: jpic Date: Wed, 15 Jun 2016 21:45:21 +0200 Subject: [PATCH 3/4] Add codecov.io --- .travis.yml | 4 +++- README.rst | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3327d92..4913089 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ env: - TOXENV=py27 - TOXENV=py35 install: -- travis_retry pip install tox +- travis_retry pip install tox codecov script: - tox +after_success: +- codecov diff --git a/README.rst b/README.rst index 79ee5c2..e0298b0 100644 --- a/README.rst +++ b/README.rst @@ -3,10 +3,13 @@ daphne .. image:: https://api.travis-ci.org/andrewgodwin/daphne.svg :target: https://travis-ci.org/andrewgodwin/daphne - + .. image:: https://img.shields.io/pypi/v/daphne.svg :target: https://pypi.python.org/pypi/daphne +.. image:: https://codecov.io/github/andrewgodwin/daphne/coverage.svg?branch=master + :target: https://codecov.io/github/andrewgodwin/daphne?branch=master + Daphne is a HTTP, HTTP2 and WebSocket protocol server for `ASGI `_, and developed to power Django Channels. From f66bede4fe4ec11b7344b97b6a04d229fb3da251 Mon Sep 17 00:00:00 2001 From: jpic Date: Wed, 15 Jun 2016 21:47:19 +0200 Subject: [PATCH 4/4] fixup! Add coverage report --- .coveragerc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..b3f29fa --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[paths] +source = + daphne/ + +[report] +omit = + .tox/*