Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Flesh out documentation for running SyTest against Synapse, including use of Postgres and worker mode. #12271

Merged
merged 4 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12271.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Clarify documentation for running SyTest against Synapse, including use of Postgres and worker mode.
8 changes: 7 additions & 1 deletion docs/development/contributing_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,14 @@ configuration:
```sh
$ docker run --rm -it -v /path/where/you/have/cloned/the/repository\:/src:ro -v /path/to/where/you/want/logs\:/logs matrixdotorg/sytest-synapse:buster
```
(Note that the paths must be full paths! You could also write `$(realpath relative/path)` if needed.)

This configuration should generally cover your needs. For more details about other configurations, see [documentation in the SyTest repo](https:/matrix-org/sytest/blob/develop/docker/README.md).
This configuration should generally cover your needs.

- To run with Postgres, supply the `-e POSTGRES=1 -e MULTI_POSTGRES=1` environment flags.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MULTI_POSTGRES seems undocumented on the sytest side, but seems to run separate databases for main and state. I feel like that's a somewhat weird thing to normally test against and is probably not necessarily here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems more correct than running them in unified mode, since that means that queries can run against both (which of course won't work in multi-Postgres mode).
However this was just what I was told to run.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems more correct than running them in unified mode, since that means that queries can run against both (which of course won't work in multi-Postgres mode).

I'm not sure why it seems more correct? Can you elaborate a bit about what you mean!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I can elaborate a bit on that last clause about what I mean!

If you have two separate Postgres databases, then fewer potential queries will work in that context than if you only had one. Put another way, a test result from a test with one unified database offers no implication that the code will work with split databases.
As a general idea, I think it's good to test things with the most restrictive configuration possible — in that sense, it'd be somewhat weird to test against the unified database (though of course there are reasons for that too, and in any case it's good to cover all the corners eventually, but maybe that explains why as a first approximation it seems less correct to test in a situation where the databases aren't isolated).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document this on the sytest side so that when someone tries to figure out what they do by following the link it says something there?

- To run with Synapse in worker mode, supply the `-e WORKERS=1 -e REDIS=1` environment flags (in addition to the Postgres flags).

For more details about other configurations, see the [Docker-specific documentation in the SyTest repo](https:/matrix-org/sytest/blob/develop/docker/README.md).


## Run the integration tests ([Complement](https:/matrix-org/complement)).
Expand Down