From 4b230ae280634001fe5482dfeeebde686d589d0c Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Tue, 13 Nov 2018 14:33:24 -0600 Subject: [PATCH 1/5] coveragerc --- .coveragerc | 12 ++++++++++++ MANIFEST.in | 1 + tox.ini | 17 ++++++++++++++--- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 000000000000..ca333961f3b4 --- /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 25cdf0a61bd6..d0e49713daec 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/tox.ini b/tox.ini index 03ddaeb0b71b..eb1d9f809495 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 @@ -122,7 +133,7 @@ skip_install = True basepython = python3.6 deps = flake8 -commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" +commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" [testenv:check_isort] skip_install = True From ca6d517ad3979ff9fb43986fed01c80a78e0721f Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Tue, 13 Nov 2018 15:19:59 -0600 Subject: [PATCH 2/5] changelog --- changelog.d/4180.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/4180.misc diff --git a/changelog.d/4180.misc b/changelog.d/4180.misc new file mode 100644 index 000000000000..80194b3dc097 --- /dev/null +++ b/changelog.d/4180.misc @@ -0,0 +1 @@ +A coveragerc file, as well as the py36-coverage tox target, have been added. From 7160c832fe81d5c21479f9316127dc1c6520b02e Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Thu, 15 Nov 2018 10:23:25 -0600 Subject: [PATCH 3/5] Update tox.ini --- tox.ini | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index eb1d9f809495..f611b1a7edd8 100644 --- a/tox.ini +++ b/tox.ini @@ -133,8 +133,7 @@ skip_install = True basepython = python3.6 deps = flake8 -commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" - +commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" [testenv:check_isort] skip_install = True deps = isort From 3c3134422230eaf4cbf359b3fcd1b86d203b1ac6 Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Thu, 15 Nov 2018 10:24:11 -0600 Subject: [PATCH 4/5] Update tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index f611b1a7edd8..1cf22aa11856 100644 --- a/tox.ini +++ b/tox.ini @@ -133,7 +133,7 @@ skip_install = True basepython = python3.6 deps = flake8 -commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" +commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" [testenv:check_isort] skip_install = True deps = isort From dc408c4870b07cccb92ceed79237c31945f5784d Mon Sep 17 00:00:00 2001 From: Amber Brown Date: Thu, 15 Nov 2018 10:24:31 -0600 Subject: [PATCH 5/5] Update tox.ini --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 1cf22aa11856..dfd9afdd495d 100644 --- a/tox.ini +++ b/tox.ini @@ -134,6 +134,7 @@ basepython = python3.6 deps = flake8 commands = /bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}" + [testenv:check_isort] skip_install = True deps = isort