From 73ec8a507dca0b4fc2b7d1129ca65e5833a9e9e0 Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Tue, 17 May 2022 18:06:38 +0000 Subject: [PATCH] deploy: 0d17357fcdded3fa3f8a37db7b6b9aa0402a10ed --- develop/development/contributing_guide.html | 18 ++++++++++++++++-- develop/print.html | 18 ++++++++++++++++-- develop/searchindex.js | 2 +- develop/searchindex.json | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/develop/development/contributing_guide.html b/develop/development/contributing_guide.html index 3aeafe7b4d..4794124f9a 100644 --- a/develop/development/contributing_guide.html +++ b/develop/development/contributing_guide.html @@ -279,7 +279,20 @@ in production (and indeed, we have some code paths specific to each database). This means that we need to run our unit tests against PostgreSQL too. Our CI does this automatically for pull requests and release candidates, but it's sometimes useful to reproduce this locally.

-

To do so, configure Postgres and run trial with the +

Using Docker

+

The easiest way to do so is to run Postgres via a docker container. In one +terminal:

+
docker run --rm -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_USER=postgres -e POSTGRES_DB=postgress -p 5432:5432 postgres:14
+
+

If you see an error like

+
docker: Error response from daemon: driver failed programming external connectivity on endpoint nice_ride (b57bbe2e251b70015518d00c9981e8cb8346b5c785250341a6c53e3c899875f1): Error starting userland proxy: listen tcp4 0.0.0.0:5432: bind: address already in use.
+
+

then something is already bound to port 5432. You're probably already running postgres locally.

+

Once you have a postgres server running, invoke trial in a second terminal:

+
SYNAPSE_POSTGRES=1 SYNAPSE_POSTGRES_HOST=127.0.0.1 SYNAPSE_POSTGRES_USER=postgres SYNAPSE_POSTGRES_PASSWORD=mysecretpassword poetry run trial tests
+
+

Using an existing Postgres installation

+

If you have postgres already installed on your system, you can run trial with the following environment variables matching your configuration: