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: test no longer accepts list of files to test #26990

Closed
allenpetersen opened this issue Aug 14, 2018 · 2 comments
Closed

cmd/go: test no longer accepts list of files to test #26990

allenpetersen opened this issue Aug 14, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@allenpetersen
Copy link

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

go1.11rc1

Does this issue reproduce with the latest release?

This works in go1.10.3 and go1.11beta3

We might have been doing this wrong for years but we had some Makefiles that listed out the files we wanted to test in a package. With go1.11rc1 in module mode this no longer works.

It looks like this was done as a way to exclude some tests. I've changed our Makefiles so this isn't a blocking issue.

root@f677d648e597:/go/src/test# ls
nothing_test.go
root@f677d648e597:/go/src/test# cat nothing_test.go
package nothing

import "testing"

func TestNothing(t *testing.T) {
}
root@f677d648e597:/go/src/test# export GO111MODULE=auto
root@f677d648e597:/go/src/test# go test -count=1
PASS
ok  	test	0.002s
root@f677d648e597:/go/src/test# go test -count=1 ./nothing_test.go
ok  	command-line-arguments	0.002s
root@f677d648e597:/go/src/test# export GO111MODULE=on
root@f677d648e597:/go/src/test# go mod init nothing
go: creating new go.mod: module nothing
root@f677d648e597:/go/src/test# go test -count=1
PASS
ok  	nothing	0.002s
root@f677d648e597:/go/src/test# go test -count=1 ./nothing_test.go
build test: cannot find module for path test

I'm fine if this was undefined behavior that will not be supported with modules. Just calling out the change in behavior.

@andybons andybons added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Aug 15, 2018
@andybons andybons added this to the Unplanned milestone Aug 15, 2018
@andybons
Copy link
Member

@rsc @bcmills @ianlancetaylor

@rsc
Copy link
Contributor

rsc commented Aug 18, 2018

Duplicate of #26046, fix pending.

@rsc rsc closed this as completed Aug 18, 2018
@golang golang locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants