From 0bc2fa76b8c44ae54328cd7f073c3cdc3309706d Mon Sep 17 00:00:00 2001 From: anoadragon453 Date: Mon, 10 Jan 2022 17:07:15 +0000 Subject: deploy: 7c3408d1a88a24c2db917ab48cb15d13ac683427 --- develop/development/contributing_guide.html | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'develop/development/contributing_guide.html') diff --git a/develop/development/contributing_guide.html b/develop/development/contributing_guide.html index 5422fad805..50f37c0338 100644 --- a/develop/development/contributing_guide.html +++ b/develop/development/contributing_guide.html @@ -292,6 +292,20 @@ trial tests.rest.admin.test_room tests.handlers.test_admin.ExfiltrateData.test_i

To increase the log level for the tests, set SYNAPSE_TEST_LOG_LEVEL:

SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
 
+

By default, tests will use an in-memory SQLite database for test data. For additional +help with debugging, one can use an on-disk SQLite database file instead, in order to +review database state during and after running tests. This can be done by setting +the SYNAPSE_TEST_PERSIST_SQLITE_DB environment variable. Doing so will cause the +database state to be stored in a file named test.db under the trial process' +working directory. Typically, this ends up being _trial_temp/test.db. For example:

+
SYNAPSE_TEST_PERSIST_SQLITE_DB=1 trial tests
+
+

The database file can then be inspected with:

+
sqlite3 _trial_temp/test.db
+
+

Note that the database file is cleared at the beginning of each test run. Thus it +will always only contain the data generated by the last run test. Though generally +when debugging, one is only running a single test anyway.

Running tests under PostgreSQL

Invoking trial as above will use an in-memory SQLite database. This is great for quick development and testing. However, we recommend using a PostgreSQL database -- cgit 1.5.1