-
Notifications
You must be signed in to change notification settings - Fork 18.1k
cmd/go: go test links and runs tests for packages with no tests #26242
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
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
release-blocker
Milestone
Comments
Looks like this may have started with 8396015 "cmd/link: set runtime.GOROOT default during link" |
CC @kyroy |
Also #26157. |
Yes, please stop linking and running tests with no tests. :-) |
This was referenced Jul 6, 2018
Closed
Change https://golang.org/cl/122518 mentions this issue: |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
NeedsDecision
Feedback is required from experts, contributors, and/or the community before a change can be made.
release-blocker
If asked to run "go test" on a directory with no *_test.go files, I expect "go test" not to build and run a test binary. Go 1.10 and earlier did not. But the current Go 1.11 tree does. Surprise!
If you run 'go test -badflag' then you can see the difference quite clearly: if the test doesn't run, nothing detects the bad flag, so it succeeds.
A more reasonable example is if you have a test helper library you use for all your tests that defines some common flag. It used to work to run
assuming that all your tests imported the library defining -my.flag. But now if any packages in that tree have no tests at all, a dummy test binary gets run that of course does not know about -my.flag
This was originally reported as a bug against vgo in #26214.
The text was updated successfully, but these errors were encountered: