7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 1 | # Matrix SDK integration test |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 2 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 3 | This set of tests requires a Synapse instance, and it runs the tests from this |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 4 | directory against this real-world server. As a result, these tests depend on the |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 5 | load of the machine/server, and as such they might be more sensitive to timing |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 6 | issues than other tests in the code base. |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 7 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 8 | ## Requirements |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 9 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 10 | This requires a synapse backend with a configuration patched for CI. You can get |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 11 | it up and running with `docker compose` via: |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 12 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 13 | ```sh |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 14 | docker compose -f assets/docker-compose.yml up -d |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 15 | docker compose -f assets/docker-compose.yml logs --tail 100 -f |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 16 | ``` |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 17 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 18 | Note that this works also with `podman compose`. |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 19 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 20 | **Patches** You can see the patches we do to configuration (namely activate |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 21 | registration and resetting rate limits, enable a few experimental features), |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 22 | check out what `assets/ci-start.sh` changes. |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 23 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 24 | ## Running |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 25 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 26 | The integration tests can be run with `cargo test` or `cargo nextest run`. |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 27 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 28 | The integration tests expect the environment variables `HOMESERVER_URL` to be |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 29 | the HTTP URL to access the synapse server and `HOMESERVER_DOMAIN` to be set to |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 30 | the domain configured in that server. These variables are set to a default value |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 31 | that matches the default `docker-compose.yml` template; if you haven't touched |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 32 | it, you don't need to manually set those environment variables. |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 33 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 34 | ## Maintenance |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 35 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 36 | ### Delete all instance data |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 37 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 38 | To stop the services and drop the database of your docker-compose cluster, run: |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 39 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 40 | ```bash |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 41 | docker compose -f assets/docker-compose.yml down --volumes --remove-orphans -t 0 |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 42 | ``` |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 43 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 44 | ### Rebuild the synapse image |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 45 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 46 | If the Synapse image has been updated in version, you may need to rebuild the |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 47 | custom Synapse image using the following: |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 48 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 49 | ```bash |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 50 | docker compose -f assets/docker-compose.yml build --pull synapse |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 51 | ``` |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 52 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 53 | Then restart the synapse service: |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 54 | |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 55 | ```bash |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 56 | docker compose -f assets/docker-compose.yml up -d synapse |
7ff8adafe9e4 | atagen | 2026-10-22 12:30 UTC | 57 | ``` |