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

Commit e21c347

Browse files
Document how to see logger output when running the twisted tests (#10148)
1 parent e6245e6 commit e21c347

File tree

3 files changed

+26
-13
lines changed

3 files changed

+26
-13
lines changed

CONTRIBUTING.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,19 @@ source ./env/bin/activate
173173
trial tests.rest.admin.test_room tests.handlers.test_admin.ExfiltrateData.test_invite
174174
```
175175

176-
If your tests fail, you may wish to look at the logs:
176+
If your tests fail, you may wish to look at the logs (the default log level is `ERROR`):
177177

178178
```sh
179179
less _trial_temp/test.log
180180
```
181181

182+
To increase the log level for the tests, set `SYNAPSE_TEST_LOG_LEVEL`:
183+
184+
```sh
185+
SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
186+
```
187+
188+
182189
## Run the integration tests.
183190

184191
The integration tests are a more comprehensive suite of tests. They

README.rst

Lines changed: 17 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,23 @@ 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+
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+
For more tips on running the unit tests, like running a specific test or
331+
to see the logging output, see the `CONTRIBUTING doc <CONTRIBUTING.md#run-the-unit-tests>`_.
327332

328333

329334
Running the Integration Tests

changelog.d/10148.misc

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)