mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-02-15 18:12:57 -05:00
This introduces a new helper object to run arbitrary pagination requests, backwards- or forward-. At the moment they're disconnected from the event cache, although I've put the files there for future convenience, since at some point we'll want to merge the retrieved events with the cache (? maybe). This little state machine makes it possible to retrieve the initial data, given an initial event id, using the /context endpoint; then allow stateful pagination using a paginator kind of API. Paginating in the timeline indicates whether we've reached the start/end of the timeline. The test for the state subscription is quite extensive and makes sure the basic functionality works as intended. Some testing helpers have been (re)introduced in the SDK crate, simplifying the code, and introducing a better `EventFactory` / `EventBuilder` pattern than the existing one in the `matrix-sdk-test` crate. In particular, this can make use of some types in `matrix-sdk`, notably `SyncTimelineEvent` and `TimelineEvent`, and I've found the API to be simpler to use as well. Part of #3234.
Matrix SDK integration test
Requirements
This requires a synapse backend with a ci patched configuration. You can easily get
it up and running with docker compose via:
docker compose -f assets/docker-compose.yml up -d
docker compose -f assets/docker-compose.yml logs --tail 100 -f
Note that this works also with podman compose.
Patches
You can see the patches we do to configuration (namely activate registration and
resetting rate limits), check out what assets/ci-start.sh changes.
Running
The integration tests can be run with cargo test or cargo nextest run.
The integration tests expect the environment variables HOMESERVER_URL to be the HTTP URL to
access the synapse server and HOMESERVER_DOMAIN to be set to the domain configured in
that server. If you are using the provided docker-compose.yml, the default will be fine.
Maintenance
To drop the database of your docker compose run:
docker compose -f assets/docker-compose.yml down --volumes