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
proposal: cmd/go: make "go test" exit 0 if *.go files exist but none match context #39426
Comments
It's unclear what the change would be here exactly. Files that exist but don't match context are treated the same as if they didn't exist at all.
Currently
and that is consistent with It seems like all of those four really need to fail instead of just printing a warning. So then the question is whether We may have backed ourselves into a bit of a puzzle where there's no easy way out. |
Adding to minutes; I still don't see an easy way out here. |
This proposal has been added to the active column of the proposals project |
The current Might be good to know about the other build system and whether it can avoid running As a point of comparison, Bazel will generally have |
IMO the cleaner solution here is to set up the For the Then |
FWIW that's just |
Based on the discussion above, this proposal seems like a likely decline. |
No change in consensus, so declined. |
It's a little weird right now that
go test
in a directory of non-context-matching*.go
files (likegolang.org/x/sys/windows/registry
on Linux) results in an error, butgo test
in a directory without tests is fine (exit 0), andgo test ./...
is also fine, as long as one directory somewhere has a context-matching file.Can we instead make go test act more like the package has no tests? I'd like to see:
This arose due to integration of Go in another build system (that builds non-Go stuff) and that build system was using the heuristic that if a directory contains
*_test.go
files, it runninggo test
in that directory was reasonable. That's currently not true for directories likex/sys/windows/registry
or other such OS-specific packages.The text was updated successfully, but these errors were encountered: