summary refs log tree commit diff
path: root/tests/rest/client/sliding_sync/test_extensions.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@element.io>2024-09-01 11:25:39 +0100
committerGitHub <noreply@github.com>2024-09-01 11:25:39 +0100
commit709b7363fe13705f37389cce3ab21f0285f359c8 (patch)
tree55b8e6e5379e3c534d1295c5b08e22cd3b39a1bd /tests/rest/client/sliding_sync/test_extensions.py
parentSliding Sync: Split up `get_room_membership_for_user_at_to_token` (#17629) (diff)
downloadsynapse-709b7363fe13705f37389cce3ab21f0285f359c8.tar.xz
Sliding sync: use new DB tables (#17630)
Based on https://github.com/element-hq/synapse/pull/17629

Utilizing the new sliding sync tables added in
https://github.com/element-hq/synapse/pull/17512 for fast acquisition of
rooms for the user and filtering/sorting.

---------

Co-authored-by: Eric Eastwood <eric.eastwood@beta.gouv.fr>
Diffstat (limited to 'tests/rest/client/sliding_sync/test_extensions.py')
-rw-r--r--tests/rest/client/sliding_sync/test_extensions.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/rest/client/sliding_sync/test_extensions.py b/tests/rest/client/sliding_sync/test_extensions.py

index ae823d5415..32478467aa 100644 --- a/tests/rest/client/sliding_sync/test_extensions.py +++ b/tests/rest/client/sliding_sync/test_extensions.py
@@ -14,7 +14,7 @@ import logging from typing import Literal -from parameterized import parameterized +from parameterized import parameterized, parameterized_class from typing_extensions import assert_never from twisted.test.proto_helpers import MemoryReactor @@ -30,6 +30,18 @@ from tests.rest.client.sliding_sync.test_sliding_sync import SlidingSyncBase logger = logging.getLogger(__name__) +# FIXME: This can be removed once we bump `SCHEMA_COMPAT_VERSION` and run the +# foreground update for +# `sliding_sync_joined_rooms`/`sliding_sync_membership_snapshots` (tracked by +# https://github.com/element-hq/synapse/issues/17623) +@parameterized_class( + ("use_new_tables",), + [ + (True,), + (False,), + ], + class_name_func=lambda cls, num, params_dict: f"{cls.__name__}_{'new' if params_dict['use_new_tables'] else 'fallback'}", +) class SlidingSyncExtensionsTestCase(SlidingSyncBase): """ Test general extensions behavior in the Sliding Sync API. Each extension has their @@ -49,6 +61,8 @@ class SlidingSyncExtensionsTestCase(SlidingSyncBase): self.storage_controllers = hs.get_storage_controllers() self.account_data_handler = hs.get_account_data_handler() + super().prepare(reactor, clock, hs) + # Any extensions that use `lists`/`rooms` should be tested here @parameterized.expand([("account_data",), ("receipts",), ("typing",)]) def test_extensions_lists_rooms_relevant_rooms(