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

cmd/go: test should print the failure cases to stderr #21944

Closed
rakyll opened this issue Sep 20, 2017 · 3 comments
Closed

cmd/go: test should print the failure cases to stderr #21944

rakyll opened this issue Sep 20, 2017 · 3 comments
Milestone

Comments

@rakyll
Copy link
Contributor

rakyll commented Sep 20, 2017

The go test output is quite noisy when -v is set. It would be great to be able to differentiate the failed cases and their details.

One differentiator would be writing the failure details to the stderr, then the tools can colorize or filter the stderr to highlight the failures:

stderrtest

/cc @rsc @ianlancetaylor

@rakyll rakyll added this to the Go1.10 milestone Sep 20, 2017
@ianlancetaylor
Copy link
Contributor

Some way to colorize sounds good to me, but mixing stdout/stderr doesn't seem like the right approach. I think there will be too many scenarios in which the output gets out of sync.

@rsc
Copy link
Contributor

rsc commented Sep 20, 2017

Writing to stderr is not right. Like Ian said, it's too easy to get stdout and stderr out of sync that way. They're not for fine-grained interleaving of the same output. Here there's just one output stream so it all goes to one output. (The canonical case for stdout/stderr would be something like cat, where the output goes to stdout but errors about not being able to open or read input files go to stderr.)

If you want to write a program to read a test's output and presents it in color, that seems easy to do with the current output, without any additional help from the go command or the testing package.

@rsc rsc closed this as completed Sep 20, 2017
@rakyll
Copy link
Contributor Author

rakyll commented Sep 21, 2017

I will write a tool to consume the go test output instead, thanks for the input.

@golang golang locked and limited conversation to collaborators Sep 21, 2018
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

4 participants