summary refs log tree commit diff
path: root/tox.ini
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-11-28 20:59:31 +1100
committerGitHub <noreply@github.com>2018-11-28 20:59:31 +1100
commit8ca53fb53e1601f83c68a464b3390b4e22f25233 (patch)
treef1d380c7dc147d3930a00278b01f292d2f77d5ff /tox.ini
parentNeilj/fix mau initial reserved users (#4211) (diff)
downloadsynapse-8ca53fb53e1601f83c68a464b3390b4e22f25233.tar.xz
Report combined coverage to codecov (#4225)
Diffstat (limited to '')
-rw-r--r--tox.ini29
1 files changed, 17 insertions, 12 deletions
diff --git a/tox.ini b/tox.ini
index dfd9afdd49..731094b5da 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,6 +7,7 @@ deps =
     mock
     python-subunit
     junitxml
+    coverage
 
     # needed by some of the tests
     lxml
@@ -27,11 +28,15 @@ deps =
 
 setenv =
     PYTHONDONTWRITEBYTECODE = no_byte_code
+    COVERAGE_PROCESS_START = {toxinidir}/.coveragerc
 
 [testenv]
 deps =
     {[base]deps}
 
+whitelist_externals =
+    sh
+
 setenv =
     {[base]setenv}
 
@@ -39,7 +44,9 @@ passenv = *
 
 commands =
     /usr/bin/find "{toxinidir}" -name '*.pyc' -delete
-    "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
+    # Add this so that coverage will run on subprocesses
+    sh -c 'echo "import coverage; coverage.process_startup()" > {envsitepackagesdir}/../sitecustomize.py'
+    {envbindir}/coverage run "{envbindir}/trial" {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
 
 [testenv:py27]
 
@@ -101,17 +108,6 @@ usedevelop=true
 [testenv:py36]
 usedevelop=true
 
-
-[testenv:py36-coverage]
-usedevelop=true
-deps =
-    {[base]deps}
-    coverage
-commands =
-    /usr/bin/find "{toxinidir}" -name '*.pyc' -delete
-    python -m coverage run -m twisted.trial {env:TRIAL_FLAGS:} {posargs:tests} {env:TOXSUFFIX:}
-
-
 [testenv:py36-postgres]
 usedevelop=true
 deps =
@@ -146,3 +142,12 @@ deps = towncrier>=18.6.0rc1
 commands =
    python -m towncrier.check --compare-with=origin/develop
 basepython = python3.6
+
+[testenv:codecov]
+skip_install = True
+deps =
+    coverage
+    codecov
+commands =
+    coverage combine
+    codecov -X gcov
\ No newline at end of file