Skip to content
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

Realtime output of "run test(s)" code lens #917

Closed
ronakg opened this issue Nov 13, 2020 · 3 comments
Closed

Realtime output of "run test(s)" code lens #917

ronakg opened this issue Nov 13, 2020 · 3 comments

Comments

@ronakg
Copy link

ronakg commented Nov 13, 2020

Is your feature request related to a problem? Please describe.
When I trigger a test or multiple tests, the output of the tests shows up only after all tests have finished.

Describe the solution you'd like
The output of go test should be displayed in realtime in the output window like how it works in a terminal.

Describe alternatives you've considered
Running the go test command manually in a terminal is an option, but I don't get the code coverage from that.

@gopherbot
Copy link
Collaborator

Change https://golang.org/cl/269917 mentions this issue: src/goTest: always mark workspace uri as directory

@hyangah
Copy link
Contributor

hyangah commented Nov 13, 2020

@ronakg Thanks for the report. For workspace testing, I sent the fix for a bug that caused unnecessary buffering.
In a single file test mode, go test buffers t.Log unless -v is specified. (https://golang.org/doc/go1.14#go-command).
#900 discusses another recently discovered issue related to streaming test output even with -v.

The purpose of buffering is to expand the file names in the failed test output message to the full paths, so the convenient file link feature of vscode can work. The info necessary for the file name expansion (package name) is at the end of each test, so it can't be perfectly real time.

@ronakg
Copy link
Author

ronakg commented Nov 13, 2020

@hyangah Thanks for letting me know. I'm already using -v for all my test runs by having this configuration.

    "go.testFlags": [
        "-v"
    ]

The purpose of buffering is to expand the file names in the failed test output message to the full paths, so the convenient file link feature of vscode can work. The info necessary for the file name expansion (package name) is at the end of each test, so it can't be perfectly real time.

Is it possible to have an option to chose this behavior? For me personally, having real-time output of t.Log, fmt.Print* and my own logs is far more important than having full paths for filenames in the output.

@hyangah hyangah added this to the v0.19.0 milestone Nov 17, 2020
@golang golang locked and limited conversation to collaborators Nov 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants