go testing [no test files] message when everything is setup properly

2,200 views
Skip to first unread message

Allison Richardet

unread,
May 13, 2016, 12:55:58 PM5/13/16
to golang-nuts
The location of my files and test files are correct, and they are using the correct package.

When I run any of the following, the test is run and passes:
go test ./name_test.go ./name.go (in dir where files reside)
godep go test path/to/files/name_test.go path/to/files/name.go

However, if I run any of the following, the results are [no test files]:
godep go test ./path/to/files
go test . (in dir where files reside)
godep go test ./...

I have a lot of test files and want to be able to godep go test ./..., which has worked in the past.
Any help would be greatly appreciated.

Justin Israel

unread,
May 13, 2016, 4:01:52 PM5/13/16
to Allison Richardet, golang-nuts

Are you source and test files all in a single directory, and is that directory on the GOPATH? Are they using the same package name?


--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Allison Richardet

unread,
May 15, 2016, 3:32:11 PM5/15/16
to golang-nuts
Yes, they are in the same directory which is on the GOPATH, and they are using the same package name. When I run godep go test ./...
some of the tests pass as I would expect, while others output [no test files].

dagn...@hpe.com

unread,
May 15, 2016, 5:55:41 PM5/15/16
to golang-nuts, all...@tetriscodes.com
I am also seeing this issue for tests where source files are  in different directories.
Reply all
Reply to author
Forward
0 new messages