Skip to content

lib/log: write test output to testing.TB

Created by: bobheadxi

This writes test output to t.Log, which allows us to integrate with 'go test' output management. I think this closes https://github.com/sourcegraph/sourcegraph/pull/35299

Also introduces logtest.ScopedWith(t testing.TB, options LoggerOptions) with additional configuration.

Related discussion: https://sourcegraph.slack.com/archives/C3B3SDBMY/p1652432949068519

edit - Actually I realized I implemented the above wrong. When I fixed it, I realized -v already works hiding output out-of-the-box (notice similar behaviour with -v in screenshots below). Do we need to do this? => https://github.com/sourcegraph/sourcegraph/pull/35430#issuecomment-1127291504

Test plan

Before:

image

After:

image

old screenshot: https://user-images.githubusercontent.com/23356519/168342703-005445b4-16d4-45c5-8679-16097d8ef5ae.png

Merge request reports

Loading