File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,18 @@ The above commands will leave a running ScyllaDB cluster in the background.
4949To stop it, use ` make down ` .\
5050Starting 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
5466Before sending a pull request, it is a good idea to run ` make ci ` locally (or ` make dockerized-ci ` if on macOS).
You can’t perform that action at this time.
0 commit comments