summary refs log tree commit diff
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2018-11-15 10:50:08 -0600
committerGitHub <noreply@github.com>2018-11-15 10:50:08 -0600
commita51288e5d6878da8ac889c8a503a6791e5b2ac43 (patch)
tree99cfc099208da590f53685c44289a4cffd319a4c
parentMerge pull request #4188 from matrix-org/rav/readme-update-1 (diff)
downloadsynapse-a51288e5d6878da8ac889c8a503a6791e5b2ac43.tar.xz
Add a coveragerc (#4180)
-rw-r--r--.coveragerc12
-rw-r--r--MANIFEST.in1
-rw-r--r--changelog.d/4180.misc1
-rw-r--r--tox.ini15
4 files changed, 27 insertions, 2 deletions
diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000000..ca333961f3
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,12 @@
+[run]
+branch = True
+parallel = True
+source = synapse
+
+[paths]
+source=
+   coverage
+
+[report]
+precision = 2
+ignore_errors = True
diff --git a/MANIFEST.in b/MANIFEST.in
index 25cdf0a61b..d0e49713da 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -34,6 +34,7 @@ prune .github
 prune demo/etc
 prune docker
 prune .circleci
+prune .coveragerc
 
 exclude jenkins*
 recursive-exclude jenkins *.sh
diff --git a/changelog.d/4180.misc b/changelog.d/4180.misc
new file mode 100644
index 0000000000..80194b3dc0
--- /dev/null
+++ b/changelog.d/4180.misc
@@ -0,0 +1 @@
+A coveragerc file, as well as the py36-coverage tox target, have been added.
diff --git a/tox.ini b/tox.ini
index 03ddaeb0b7..dfd9afdd49 100644
--- a/tox.ini
+++ b/tox.ini
@@ -70,7 +70,7 @@ usedevelop=true
 usedevelop=true
 deps =
     {[base]deps}
-     psycopg2
+    psycopg2
 setenv =
     {[base]setenv}
     SYNAPSE_POSTGRES = 1
@@ -101,11 +101,22 @@ 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 =
     {[base]deps}
-     psycopg2
+    psycopg2
 setenv =
     {[base]setenv}
     SYNAPSE_POSTGRES = 1