Skip to content

Commit 667863b

Browse files
wprzytulaLorak-mmk
andcommitted
CONTIBUTING.MD: mention setup_tracing
...so that new tests have setup_tracing() added. Co-authored-by: Karol Baryła <[email protected]>
1 parent d7eac92 commit 667863b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ The above commands will leave a running ScyllaDB cluster in the background.
4949
To stop it, use `make down`.\
5050
Starting a cluster without running any test is possible with `make up`.
5151

52+
### Tracing in tests
53+
54+
By default cargo captures `print!` macro's output from tests and prints them for failed tests.
55+
This is a bit problematic for us in case of `tracing` crate logs, because traces are not printed
56+
unless a subscriber is set. That's why we have a helper function for tests: `setup_tracing`.
57+
It sets up a tracing subscriber with env filter (so you can filter traces using env variables)
58+
and with a Writer that is compatible with test framework's output capturing.
59+
60+
Most of the tests already call this function, and any new tests should too.
61+
If you want to see tracing output from a failing test and it doesn't call this function,
62+
simply add the call at the beginning of the test.
63+
5264
## CI
5365

5466
Before sending a pull request, it is a good idea to run `make ci` locally (or `make dockerized-ci` if on macOS).

0 commit comments

Comments
 (0)