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

x/vgo: vgo test does not honor special/test toolkit flags when wildcards are used #26214

Closed
erikh opened this issue Jul 4, 2018 · 4 comments

Comments

@erikh
Copy link

commented Jul 4, 2018

Please answer these questions before submitting your issue. Thanks!

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

erikh@ab4ac25b692d:~$ go version
go version go1.10.3 linux/amd64
erikh@ab4ac25b692d:~$ vgo version
go version go1.10.3 linux/amd64 vgo:2018-02-20.1
erikh@ab4ac25b692d:~$ 

Does this issue reproduce with the latest release?

Yes, AFAIK I am using the latest release.

What operating system and processor architecture are you using (go env)?

erikh@ab4ac25b692d:~$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/go/src/github.com/erikh/thing/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build371740159=/tmp/go-build -gno-record-gcc-switches"

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

Put the following in one dir named db and make another dir with a go file, just a package statement should do.

https://play.golang.org/p/FJlfCzFvCXK

What did you expect to see?

vgo test -v ./... -check.v behaving like go test -v ./... -check.v

What did you see instead?

When go test -v ./... -check.v is invoked, the parameter is provided properly to test dirs that need it, and not to test dirs that don't; specifically dirs with no tests.

vgo OTOH will bail when that last argument is provided. If you specify the direct path to the package such as ./db, it works fine.

Hope this is useful!

@gopherbot gopherbot added this to the vgo milestone Jul 4, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Jul 4, 2018

vgo OTOH will bail when that last argument is provided.

“Bail” in what way? Exact output would be helpful.

@erikh

This comment has been minimized.

Copy link
Author

commented Jul 5, 2018

Sorry to be unclear. Here you go; this is vgo test -v ./... -check.v on the project: https://gist.github.com/erikh/b03ae179dd4aa63389fce40db38f029e

The db package has tests that use go-check, the others have no tests, or no files completely.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2018

There's not actually magic going on with -check.v. It used to be that when you had a directory with no *_test.go files in it and you ran "go test", nothing happened. Now the go command seems to build and run a test program instead, and of course that program does not import check.v1 and so it doesn't have the -check.v flag.

I filed #26242 and will close this issue. Thanks very much for the report - we'll be sure to get it fixed for Go 1.11.

@rsc rsc closed this Jul 6, 2018

@erikh

This comment has been minimized.

Copy link
Author

commented Jul 6, 2018

@golang golang locked and limited conversation to collaborators Jul 6, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.