diff options
author | Neil Johnson <neil@matrix.org> | 2018-11-28 10:09:55 +0000 |
---|---|---|
committer | Neil Johnson <neil@matrix.org> | 2018-11-28 10:09:55 +0000 |
commit | 430ea681711acb10bbf5813e48fe963374e42e02 (patch) | |
tree | 5e97ac7793c333241eedf63afd8cf59d9b8ce5e5 | |
parent | fix race condition (diff) | |
parent | Report combined coverage to codecov (#4225) (diff) | |
download | synapse-430ea681711acb10bbf5813e48fe963374e42e02.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into neilj/create_support_user
-rw-r--r-- | .travis.yml | 10 | ||||
-rw-r--r-- | changelog.d/4211.bugfix | 2 | ||||
-rw-r--r-- | changelog.d/4225.misc | 1 | ||||
-rw-r--r-- | synapse/storage/monthly_active_users.py | 5 | ||||
-rw-r--r-- | tox.ini | 29 |
5 files changed, 28 insertions, 19 deletions
diff --git a/.travis.yml b/.travis.yml index 655fab9d8e..84d5efff9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,24 +36,24 @@ matrix: env: TOX_ENV="pep8,check_isort" - python: 2.7 - env: TOX_ENV=py27 TRIAL_FLAGS="-j 2" + env: TOX_ENV=py27,codecov TRIAL_FLAGS="-j 2" - python: 2.7 env: TOX_ENV=py27-old TRIAL_FLAGS="-j 2" - python: 2.7 - env: TOX_ENV=py27-postgres TRIAL_FLAGS="-j 4" + env: TOX_ENV=py27-postgres,codecov TRIAL_FLAGS="-j 4" services: - postgresql - python: 3.5 - env: TOX_ENV=py35 TRIAL_FLAGS="-j 2" + env: TOX_ENV=py35,codecov TRIAL_FLAGS="-j 2" - python: 3.6 - env: TOX_ENV=py36 TRIAL_FLAGS="-j 2" + env: TOX_ENV=py36,codecov TRIAL_FLAGS="-j 2" - python: 3.6 - env: TOX_ENV=py36-postgres TRIAL_FLAGS="-j 4" + env: TOX_ENV=py36-postgres,codecov TRIAL_FLAGS="-j 4" services: - postgresql diff --git a/changelog.d/4211.bugfix b/changelog.d/4211.bugfix new file mode 100644 index 0000000000..376f80c55a --- /dev/null +++ b/changelog.d/4211.bugfix @@ -0,0 +1,2 @@ +fix start up failure when mau_limit_reserved_threepids set and db is postgres + diff --git a/changelog.d/4225.misc b/changelog.d/4225.misc new file mode 100644 index 0000000000..39062696ea --- /dev/null +++ b/changelog.d/4225.misc @@ -0,0 +1 @@ +Added automated coverage reporting to CI. diff --git a/synapse/storage/monthly_active_users.py b/synapse/storage/monthly_active_users.py index c31dbaec72..6e162a5fcd 100644 --- a/synapse/storage/monthly_active_users.py +++ b/synapse/storage/monthly_active_users.py @@ -34,8 +34,9 @@ class MonthlyActiveUsersStore(SQLBaseStore): self.hs = hs self.reserved_users = () # Do not add more reserved users than the total allowable number - self._initialise_reserved_users( - dbconn.cursor(), + self._new_transaction( + dbconn, "initialise_mau_threepids", [], [], + self._initialise_reserved_users, hs.config.mau_limits_reserved_threepids[:self.hs.config.max_mau_value], ) 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 |