1 files changed, 14 insertions, 0 deletions
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
<p>To increase the log level for the tests, set <code>SYNAPSE_TEST_LOG_LEVEL</code>:</p>
<pre><code class="language-sh">SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
</code></pre>
+<p>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 <code>SYNAPSE_TEST_PERSIST_SQLITE_DB</code> environment variable. Doing so will cause the
+database state to be stored in a file named <code>test.db</code> under the trial process'
+working directory. Typically, this ends up being <code>_trial_temp/test.db</code>. For example:</p>
+<pre><code class="language-sh">SYNAPSE_TEST_PERSIST_SQLITE_DB=1 trial tests
+</code></pre>
+<p>The database file can then be inspected with:</p>
+<pre><code class="language-sh">sqlite3 _trial_temp/test.db
+</code></pre>
+<p>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 <em>last run test</em>. Though generally
+when debugging, one is only running a single test anyway.</p>
<h3 id="running-tests-under-postgresql"><a class="header" href="#running-tests-under-postgresql">Running tests under PostgreSQL</a></h3>
<p>Invoking <code>trial</code> as above will use an in-memory SQLite database. This is great for
quick development and testing. However, we recommend using a PostgreSQL database
|