axw/gocov

gocov with coverprofile raise error, the file path contains duplicate parts

maxin93 opened this issue · 1 comments

I have got the kubernetes coverprofile with make test, I want to convert the profile to html with gocov-html, but when I run gocov to convert the combined-coverage.out to json format under the dir of /opt/zz/kubernetes which is the source root of my code, it raise the following error messages:
error: open /opt/zz/kubernetes/vendor/k8s.io/kubernetes/vendor/k8s.io/api/core/v1/generated.pb.go: no such file or directory unmarshal coverage data: unexpected end of JSON input

I found that the file exist, but the path with duplicate parts, the exist file path is /opt/zz/kubernetes/vendor/k8s.io/api/core/v1/generated.pb.go, I guess that there must be some misconfiguration, can anyone help me?
image

axw commented

I guess gocov has a problem with vendored code.

Have you considered using go tool cover -html instead?