Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 37ec1ba

Browse files
committed
Document how to see logger output when running the twisted tests
As shared by @erikjohnston#9247 (comment)
1 parent c7f3fb2 commit 37ec1ba

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

README.rst

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -293,18 +293,6 @@ try installing the failing modules individually::
293293

294294
pip install -e "module-name"
295295

296-
Once this is done, you may wish to run Synapse's unit tests to
297-
check that everything is installed correctly::
298-
299-
python -m twisted.trial tests
300-
301-
This should end with a 'PASSED' result (note that exact numbers will
302-
differ)::
303-
304-
Ran 1337 tests in 716.064s
305-
306-
PASSED (skips=15, successes=1322)
307-
308296
We recommend using the demo which starts 3 federated instances running on ports `8080` - `8082`
309297

310298
./demo/start.sh
@@ -324,6 +312,30 @@ If you just want to start a single instance of the app and run it directly::
324312
python -m synapse.app.homeserver --config-path homeserver.yaml
325313

326314

315+
Running the unit tests
316+
======================
317+
318+
After getting up and running, you may wish to run Synapse's unit tests to
319+
check that everything is installed correctly::
320+
321+
python -m twisted.trial tests
322+
323+
This should end with a 'PASSED' result (note that exact numbers will
324+
differ)::
325+
326+
Ran 1337 tests in 716.064s
327+
328+
PASSED (skips=15, successes=1322)
329+
330+
To run a specific test::
331+
332+
python -m twisted.trial tests.storage.test_redaction
333+
python -m twisted.trial tests.handlers.test_presence.PresenceJoinTestCase.test_remote_gets_presence_when_local_user_joins
334+
335+
To see logger output from the app while the tests run, set ``SYNAPSE_TEST_LOG_LEVEL``
336+
and the resulting logs will be in ``_trial_temp/test.log``::
337+
338+
SYNAPSE_TEST_LOG_LEVEL=DEBUG python -m twisted.trial tests
327339

328340

329341
Running the Integration Tests

changelog.d/10148.doc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Document `SYNAPSE_TEST_LOG_LEVEL` to see the logger output when running tests.

0 commit comments

Comments
 (0)