Skip to content

cmd/go: go test should not clutter output with "no test files" #20223

@joelpresence

Description

@joelpresence

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.8 darwin/amd64

What operating system and processor architecture are you using (go env)?

amd64, darwin

What did you do?

bash> cd ~/go/src/myproject
bash> go test github.com/presencelabs/...
...
go test outputs some useful test results like
ok github.com/presencelabs/ourapp/apiserver/apiservercore/rendermodels/tests 0.024s
...
go test outputs a lot of unuseful test results like
? github.com/presencelabs/ourapp/apiserver/apiservercore/service [no test files]

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

I only want to see output about which tests ran and which passed and which failed. I do NOT care about packages or dirs that have no tests in them.

What did you see instead?

I don't care about the directories/packages with no test files. I know that they don't have any test files. They are not meant to have any test files since we put our test files in subdirs called test. Telling me repeatedly that these dirs have no test files clutters the test output and obscures the important information like which tests actually ran and which passed and which failed.

Telling me that a dir has no test files should be left to the coverage tool/option. Either go test should NOT log dirs/packages that have no tests by default, or there should be an option to skip that logging as in --no-warn-no-tests or similar.

I'm happy to help with a PR if there's interest. But right now, all this clutter about no tests is really reducing our productivity and we need to run tests like clear; go test github.com/presencelabs/... | grep -v "no test files" which is cumbersome.

By the way, we love go! Thanks for your hard work on it. :-) I'm not meaning to whine, I just want to make go even better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions