2023-09-07 18:39:37 +01:00
..
2023-09-07 18:34:08 +01:00
2023-08-15 14:55:00 +01:00
2023-04-19 13:05:01 +01:00
2023-07-18 12:44:26 +01:00
2023-04-28 12:35:04 +01:00
2023-08-16 17:02:29 +01:00
2023-09-07 18:39:37 +01:00
2023-06-05 11:26:47 +01:00
2023-03-28 13:53:57 +01:00
2023-07-31 13:11:09 +01:00
2023-08-16 13:37:54 +01:00
2023-01-18 15:31:44 +00:00

End-to-End Tests

This directory contains end-to-end tests, running against a real Synapse server, and a real Proxy binary.

End-to-End tests meet the following criteria:

  • The test exclusively uses the public sliding sync API for test assertions.
  • The test exclusively uses the public sync v2 API for configuring the test.

Some examples of this include testing core functionality of the API like room subscriptions, multiple lists, filters, extensions, etc.

Counter examples include testing restarts of the proxy, testing out-of-order responses and testing connection handling. These should be integration tests.

Development

Run a Synapse in a separate terminal:

docker run --rm -e "SYNAPSE_COMPLEMENT_DATABASE=sqlite" -e "SERVER_NAME=synapse" -p 8008:8008 ghcr.io/matrix-org/synapse-service:v1.72.0

(You will need to docker login to the GitHub container registry to pull that image.)

Keep it running. Then run the tests on a fresh postgres database (run in the root of this repository):

export SYNCV3_SERVER=http://localhost:8008
export SYNCV3_DB="user=$(whoami) dbname=syncv3_test sslmode=disable"
export SYNCV3_SECRET=secret
(dropdb syncv3_test && createdb syncv3_test && cd tests-e2e && ./run-tests.sh .)

All args after run-test.sh are passed to go test so you can set timeouts/run individual tests that way, hence the . in the above example as that translated to go test ..