7 Commits

Author SHA1 Message Date
Kegan Dougal
af1f34861e Ensure txns are closed so we can wipe the db for other tests 2024-05-17 16:09:02 +01:00
Kegan Dougal
300f1e16c3 Add benchmark for number of rooms on a user's account 2022-04-01 17:23:48 +01:00
Kegan Dougal
6e55f7f608 tests: make a consistent test env for both local and CI runs
- Only have a single database for all tests, like CI.
- Calling `PrepareDBConnectionString` drops all tables before returning
  the string.
- Tests must be run with no concurrency else they will step on each other
  due to the previous point.

This should prevent cases where local tests pass but CI fails.
2021-11-09 10:15:48 +00:00
Kegan Dougal
313aa8e264 tests: use the same database name for tests
Use `dropdb -f` to nuke existing connections. Requires postgres 13+
2021-11-03 10:23:38 +00:00
Kegan Dougal
2285a7bef9 bugfix: pass events through usercache so it can return full timelines on INSERT
We lazily load timelines for rooms as the client fetches them. If a previously
lazily loaded timeine goes out of the window then back in it results in a
DELETE/INSERT. We would detect that we already have a timeline for this room
and just return that, however that timeline was stale. We now keep this timeline
in sync with live events.

With regression test.
2021-10-26 18:01:57 +01:00
Kegan Dougal
749e4d413e Add integration tests on the http handler 2021-07-21 16:35:36 +01:00
Kegan Dougal
ea0fac859a Factor out psql test rig 2021-07-21 15:28:31 +01:00