-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: -coverpkg packages imported by all tests, even ones that otherwise do not use it #23910
Comments
I think the problem is that cmd/go rewrites tests to import all packages listed in Not sure what the right fix is. |
/cc @bcmills |
Sounds like #27336 |
test
link maybe skip main package without test files
|
If you want to try a bigger project to reproduce the issue, clone https://github.com/knative/eventing and run the test with:
For more details: knative/pkg#2113 |
gocover is doing tricks to be able to process coverage across packages and defining same flags globally breaks this: golang/go#23910 golang/go#27336 A simple solution is to not make those flags global. Change-Id: I1a4fda3bcca7132e54bb1755a1a5bde52d01c340
gocover is doing tricks to be able to process coverage across packages and defining same flags globally breaks this: golang/go#23910 golang/go#27336 A simple solution is to not make those flags global. Change-Id: I1a4fda3bcca7132e54bb1755a1a5bde52d01c340
FYI, we've moved away from the model in which all |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10 windows/amd64
Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
What did you expect to see?
I expected the tests to pass regardless of how they are launched by the go tool.
What did you see instead?
Using
-coverpkg=./...
in combination with the test package pattern./...
caused a panic for a missing file even though the file exists. It is also confusing that running the tests on individual packages or without-coverpkg=./...
does not panic.The text was updated successfully, but these errors were encountered: