goreporter
goreporter copied to clipboard
Unit test coverage displays 0%
goreporter displays test coverage as 0%. However, I have few unit tests and running with
go test -cover
gives me proper coverage %.
Kindly help here.
Can you post the logs? Or any related information.
goreporter html
I am using below command to run goreporter
goreporter -p . -r . -f html
console output
Yeah, you can see log that the tool can not find your package db on your $GOPATH.
@wgliang What's the correct command to run goreporter? I have "db" package in "C:\Users\csad\git\vzt-poseidon\src\bitbucket.vtitel.net\vzt-poseidon\db" and goreporter is searching in all wrong places.
Also, GOPATH is set correctly. Still goreporter is looking in wrong folders
you can just run your command like
goreporter -p ./ -r ./ -f html
goreporter will search your packages on your $GOPATH, and it also support vendor. Obviously the path C:\Users\csad\git\vzt-poseidon\src\bitbucket.vtitel.net\vzt-poseidon\db
is not in your GOPATH(C:\Users\go
).
I think you can just move your repo into C:\Users\go\src
. And then run the command again.
I have set the GOPATH to C:\Users\csad\git\vzt-poseidon
. Still I get same error