Opened 16 years ago
Last modified 14 years ago
#393 new enhancement
get cobertura coverage form <coverage> element
Reported by: | al@… | Owned by: | cmlenz |
---|---|---|---|
Priority: | major | Milestone: | 0.6.1 |
Component: | Recipe commands | Version: | dev |
Keywords: | Cc: | trac@… | |
Operating System: | Linux |
Description
The java:cobertura recipe command reads through the whole coverage.xml file, which is huge with bigger projects (31Mb in my case). The parsing and collection of the coverage data takes ages and needs more than 1Gb memory (the machine swaps).
Cobertura offers to generate a small summary coverage report xml file (coverage-summary.xml, ant task: <cobertura-report format="summaryxml"... ), which looks like this
<coverage line-rate="0.7272727272727273" branch-rate="0.75" lines-covered="8" lines-valid="11" branches-covered="3" branches-valid="4" complexity="2.25" version="1.9.1" timestamp="1240781720861"> <packages /> </coverage>
But Bitten is not able to read this, it fails with
[ERROR ] Internal error in build step 'test' Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/Bitten-0.6dev_r629-py2.5.egg/bitten/slave.py", line 276, in _execute_step step.execute(recipe.ctxt): File "/usr/lib/python2.5/site-packages/Bitten-0.6dev_r629-py2.5.egg/bitten/recipe.py", line 191, in execute ctxt.run(self, child.namespace, child.name, child.attr) File "/usr/lib/python2.5/site-packages/Bitten-0.6dev_r629-py2.5.egg/bitten/recipe.py", line 95, in run function(self, **args) File "/usr/lib/python2.5/site-packages/Bitten-0.6dev_r629-py2.5.egg/bitten/build/javatools.py", line 194, in cobertura for s in ss.children('source')][0] IndexError: list index out of range
It would be nice if the coverage could simply be read from the <coverage> tag.
Attachments (2)
Change History (5)
comment:1 Changed 15 years ago by osimons
- Milestone changed from 0.6 to 0.6.1
comment:2 Changed 15 years ago by Mat Booth <trac@…>
- Cc trac@… added
Changed 14 years ago by bersace <ebersac@…>
comment:3 Changed 14 years ago by bersace <ebersac@…>
I have the same error with nosexcover output. Thus i wrote a Cobertura parser that doesn't fail.
I may add summary support if ever we use it here. I too find Cobertura reports a bit verbose. Typical XML usage of Java projects…
Reporting cobertura coverage XML file