radicle-dev / radicle-link

The second iteration of the Radicle code collaboration protocol.
Other
421 stars 39 forks source link

tests: use test writer for fmt subscriber #738

Closed geigerzaehler closed 2 years ago

geigerzaehler commented 2 years ago

We use the test writer for tracing_subscriber so that log output is captured by the tests. This also allows us to increase the default verboseness of the log outputs which provides more information when the tests fail.

kim commented 2 years ago

Yes we do use the capturing test writer. The defaults have been adjusted over time for CI, and it did not prove useful to dump debug level logs when tests fail — you’ll typically need to isolate the failures anyway, and then you can override via env variables.

So no, I don’t think this is better, because we had these settings already and dialled down the verbosity.

geigerzaehler commented 2 years ago

So no, I don’t think this is better, because we had these settings already and dialled down the verbosity.

Fair enough. I’ll revert the verbosity and output change.

kim commented 2 years ago

I tried this out, and it does indeed make a lot more sense now. No output at all is generated if the test passes, otherwise all the buffered logs are dumped. Having a log level higher than "error" does make sense then.

I'm still skeptical of the "pretty" format on CI, because that can easily get truncated and then you're looking at ANSI escape sequences in the "raw" view. Maybe we can default to "compact" when the CI environment variable is set, and use "pretty" otherwise.

geigerzaehler commented 2 years ago

Having a log level higher than "error" does make sense then.

Any preference for a specific level? I was leaning towards debug.

Maybe we can default to "compact" when the CI environment variable is set, and use "pretty" otherwise.

:+1:

kim commented 2 years ago

Debug seems good yes. We can fine tune it later if needed.