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: do not compile test package if non-test can't build #44624

Closed
rsc opened this issue Feb 26, 2021 · 4 comments
Closed

cmd/go: do not compile test package if non-test can't build #44624

rsc opened this issue Feb 26, 2021 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Feb 26, 2021

I keep getting output like this from go test:

% go test ./...
?   	golang.org/x/website	[no test files]
# golang.org/x/website/internal/godoc
internal/godoc/examplefuncs.go:24:14: page.Value undefined (type *Page has no field or method Value)
# golang.org/x/website/internal/godoc [golang.org/x/website/internal/godoc.test]
internal/godoc/examplefuncs.go:24:14: page.Value undefined (type *Page has no field or method Value)

It's just noise to print the same errors twice.

An easy way to fix this would be to make the test version of the package have the non-test version as a (not strictly necessary) dependency. Then if the build of the non-test version fails, the build of test version won't be attempted.

/cc @jayconrod @matloob

@rsc rsc added the NeedsFix The path to resolution is known, but the work has not been done. label Feb 26, 2021
@rsc rsc added this to the Go1.17 milestone Feb 26, 2021
@robpike
Copy link
Contributor

robpike commented Feb 26, 2021

I can't find the previous issue but I brought this up some time ago. If you can find it, what was the resolution? Or did it come back somehow?

@ALTree
Copy link
Member

ALTree commented Feb 26, 2021

@robpike This one? f0fef32

@robpike
Copy link
Contributor

robpike commented Feb 26, 2021

Yes, which points to this one: #5679

@jayconrod jayconrod added the okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 label May 17, 2021
@jayconrod jayconrod modified the milestones: Go1.17, Go1.18 Jul 29, 2021
@ianlancetaylor ianlancetaylor self-assigned this Nov 18, 2021
@gopherbot
Copy link

Change https://golang.org/cl/365215 mentions this issue: cmd/go/internal/test: add dep from test pkg build to real pkg build

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1
Projects
None yet
Development

No branches or pull requests

6 participants