eriwen / lcov-to-cobertura-xml

Converts lcov output to Cobertura-compatible XML for CI
https://eriwen.github.io/lcov-to-cobertura-xml/
Apache License 2.0
187 stars 73 forks source link

Conditionals and method coverage always shows 0/0 #19

Closed hybridcattt closed 8 years ago

hybridcattt commented 9 years ago

When I generate an xml and export it to Jenkins (Cobertura plugin) I always get 100% (0/0) coverage for methods and conditionals. All other stats are non-zero as expected. Produced xml contains methods data. What might be the problem?

gbalachander commented 9 years ago

I too have the same issue, but left it for later. I think, It happens if the build environment path is not reachable by Jenkins.

Open the generated cobertura XML file and check whether the filename mentioned is proper, i.e, it is not relative to your build environment and reachable by Jenkins or the shell in general.

hybridcattt commented 9 years ago

@gbalachander I am not sure that that could be a problem, because packages, classes, files and lines are counted and have real coverage percent. Only branches and methods are missing. Would you mind to look at resulted xml (and possibly to original clove data used as an input) to get a better idea of what might be the problem?

irecord commented 9 years ago

I get this problem too, the lcov html output contains functions with the appropriate percentages etc. though. I've also noticed that the signature attribute of the method tag is empty.

zyv commented 8 years ago

I think that there are two different problems here:

  1. lcov-to-cobertura-xml doesn't currently emit proper method data; I found that it is crucial to have at least one <line> element per <method> for Jenkins to detect them. In my PR #20, I address this problem.
  2. You are not supplying --rc lcov_branch_coverage=1 to all invocations of lcov, which is very important to get branch coverage to work. With this option set, I do get branch coverage with the current version of lcov-to-cobertura-xml.

If this is correct, then this issue can be closed as soon as my PR is merged.

eriwen commented 8 years ago

Fixed by #20