From fb9862d2c7296f9da2180719413ac3e014d9595c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Tue, 19 Jan 2016 13:50:27 +0100 Subject: [PATCH] add coveralls support --- .coveragerc | 2 ++ .travis.yml | 4 ++++ runtests.py | 2 +- tox.ini | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..746fb0c --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +include = */denorm/* diff --git a/.travis.yml b/.travis.yml index 5c18596..3ea955f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: python install: - pip install tox + - pip install coveralls before_script: - sh -c "if [ '$DB' = 'postgres' ]; then psql -c 'create database denorm_test;' -U postgres; fi;" @@ -88,3 +89,6 @@ matrix: - env: DJANGO=djangomaster DB=mysql - env: DJANGO=djangomaster DB=postgres - env: DJANGO=djangomaster DB=postgis +after_script: + - cd test_denorm_project/ + - coveralls --rcfile=../.coveragerc diff --git a/runtests.py b/runtests.py index 9799b80..65bdbc1 100755 --- a/runtests.py +++ b/runtests.py @@ -14,5 +14,5 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'test_denorm_project.settings_%s' % dbtype test_label = sys.argv[2] if len(sys.argv) > 2 else "test_app" - if os.system("cd test_denorm_project; python -Wall manage.py test %s" % test_label): + if os.system("cd test_denorm_project; coverage run manage.py test %s" % test_label): exit(1) diff --git a/tox.ini b/tox.ini index 7e9bc86..f949ae4 100644 --- a/tox.ini +++ b/tox.ini @@ -4,6 +4,7 @@ envlist = {py26,py27,py34}-django{15,16,17,18,19,master}-{sqlite,mysql,postgres, [testenv] commands = + pip install coverage sqlite: python runtests.py sqlite mysql: python runtests.py mysql postgres: python runtests.py postgres