t-yuki / gocover-cobertura

golang : go tool cover to XML (Cobertura) export tool.

Home Page:https://github.com/t-yuki/gocover-cobertura/wiki/Screenshots

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generated XML file <packages> is empty

bradleygore opened this issue · comments

Given example go test output like this:

mode: count
pos-api/internal/api/middleware/error.go:26.86,28.29 2 2
pos-api/internal/api/middleware/error.go:58.2,58.13 1 2
pos-api/internal/api/middleware/error.go:28.29,34.27 3 8
pos-api/internal/api/middleware/error.go:52.3,55.5 1 8

When running gocover-cobertura against the file I'm getting this output:

$ gocover-cobertura < ~/git/pos-api/cover.txt

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
<coverage line-rate="NaN" branch-rate="0" version="" timestamp="1565289586656" lines-covered="0" lines-valid="0" branches-covered="0" branches-valid="0" complexity="0">
        <sources>
                <source>/Users/bgore/go/src</source>
        </sources>
        <packages></packages>
</coverage>

There are no errors being logged, etc... just this empty XML file with a line-rate="NaN" ☹️

I think there was an update or something that has broken this - but I'm not sure what it would be. This used to work for me as of last week.

Go version: go version go1.12.7 darwin/amd64

This is also broken for me. go 1.12.9, on linux.

Same issue for me, for go 1.12.17

I had the same issue, for go 1.12.17. After I deleted files go.mod and go.sum (in current folder), gocover-cobertura started to work fine.

After updating to go 1.14 (I didn't check this at 1.13) this is now working for me again. Marking as closed.