New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: go test -json outputs too verbose #40588
Comments
Change https://golang.org/cl/246918 mentions this issue: |
Could you be more specific about what should and should not be printed? Why did vscode-go switch to When the Changing |
For example, the followings are 'output' type Action but these lines wouldn't appear in the non-verbose mode output.
vscode-go has to rewrite the the file names printed in the log messages to the absolute paths. Without knowing the package path of the test, we can't do this rewrite. Unfortunately, in the normal test output, the package path is printed at the end. For example,
We can't rewirte |
@jayconrod Filtering was what i initially attempted to do to fix our regression bug, and it's harder than I thought. Can it add an extra field or some sign whether the Output is for verbose or not? Currently we switched back not to use |
Maybe... I think all the messages from the test process to We have a lot of open issues related to this actually, and I wonder if we need a more complete redesign for this mechanism. |
CL/242540 made runTest uses -json mode to ease streaming test output processing. However, it turned out -json makes the test output more verbose than the standard test output. (golang/go#40588) Verbose output by default is not ideal especially when running tests on many packages. This change brings back the old test output processing logic when users do not use the `-v` flag. The `go test` command will stream test output only if the `-v` flag is specified, so the original issue CL/242540 remains addressed. Fixes #471 Updates #316 Updates golang/go#40588 Change-Id: I29d6d1319acccab2457300c118216ceebb4c4033 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/246918 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Change https://golang.org/cl/247017 mentions this issue: |
CL/242540 made runTest uses -json mode to ease streaming test output processing. However, it turned out -json makes the test output more verbose than the standard test output. (golang/go#40588) Verbose output by default is not ideal especially when running tests on many packages. This change brings back the old test output processing logic when users do not use the `-v` flag. The `go test` command will stream test output only if the `-v` flag is specified, so the original issue CL/242540 remains addressed. Fixes #471 Updates #316 Updates golang/go#40588 Change-Id: I29d6d1319acccab2457300c118216ceebb4c4033 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/246918 Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com> TryBot-Result: kokoro <noreply+kokoro@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org> (cherry picked from commit bec9cf3) Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/247017 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
If you are looking to emulate the non-verbose (I call it quiet) Edit: (to respond to the below comment without creating too much noise on this thread) There is preprocessing that happens in |
Thanks @dnephin. I see the code and it assumes some preprocessing and filtering of the test events before the standard quiet formatter is applied. So, I assume majority of the heuristic is outside of the linked function. Currently we are working around by simply not using |
The design of -json fundamentally requires -v. Otherwise we can't associated prints on standard output to the running test. I don't believe there's anything we can change for this issue. |
In theory we could restructure That would be a fairly large project, but it doesn't seem implausible to me. |
Without
-json
With
-json
Recently vscode-go switched to use
go test -json
and outputsOutput
field, but found this is too verbose (more like-v
mode).The text was updated successfully, but these errors were encountered: