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

Unit test coverage displays 0% #73

Open
adityacs opened this issue Nov 7, 2018 · 7 comments
Open

Unit test coverage displays 0% #73

adityacs opened this issue Nov 7, 2018 · 7 comments

Comments

@adityacs
Copy link

adityacs commented Nov 7, 2018

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.

@wgliang
Copy link
Collaborator

wgliang commented Nov 7, 2018

Can you post the logs? Or any related information.

@adityacs
Copy link
Author

adityacs commented Nov 7, 2018

goreporter html
image

I am using below command to run goreporter
goreporter -p . -r . -f html

console output
image

@wgliang
Copy link
Collaborator

wgliang commented Nov 7, 2018

Yeah, you can see log that the tool can not find your package db on your $GOPATH.

@adityacs
Copy link
Author

adityacs commented Nov 7, 2018

@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

@wgliang
Copy link
Collaborator

wgliang commented Nov 7, 2018

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).

@wgliang
Copy link
Collaborator

wgliang commented Nov 7, 2018

I think you can just move your repo into C:\Users\go\src. And then run the command again.

@adityacs
Copy link
Author

adityacs commented Nov 7, 2018

I have set the GOPATH to C:\Users\csad\git\vzt-poseidon. Still I get same error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants