Questions tagged [cobertura]

Cobertura is a free and open-source Java tool based on jcoverage that calculates the percentage of code and branches covered by tests.

Cobertura is a free and open-source Java tool (commonly called a code coverage tool) based on jcoverage that calculates the percentage of code and branches covered by tests.

Cobertura does this by instrumenting the compiled bytecode. It can be run from the command line, via an Ant task, via a Maven plugin, or via the eCobertura Eclipse plugin. Builds can be made to fail if the code coverage reported by Cobertura does not meet a user-set threshold value. XML and HTML reports can be generated as output.

649 questions
24
votes
4 answers

How to generate Cobertura Code Coverage Report using Maven from Hudson

In my project I need to create Cobertura Code Coverage report from Hudson using maven build. In Hudson I have added the Cobertura Code Coverage plugin. I need the complete modification steps of pom.xml.
stackoverflowsk
  • 275
  • 1
  • 5
  • 10
23
votes
3 answers

running junits and cobertura with maven

In our project, we run both junits and cobertura using maven. The problem I am facing is that, junit test cases are running twice, once before the jar creation process and then once again for generating cobertura coverage reports. When running…
Ajay
  • 977
  • 2
  • 11
  • 23
21
votes
3 answers

What is the proper way to use Cobertura with Maven 3.0.2

I have been trying unsuccessfully for the last few days to run Cobertura 2.4 with Maven 3.0.2. We have a very large project with many modules (sub-projects). What I found is that documentation is basically non-existent or plain wrong. All tutorials…
juancn
  • 2,483
  • 2
  • 20
  • 25
20
votes
3 answers

PHPUnit coverage in Cobertura format

I have a small PHP project that uses PHPUnit for unit tests and coverage. I would like to generate the coverage reports in cobertura XML format. Is there any tool or plugin that I can use to achieve this? Any help is appreciated..
Sharath
  • 969
  • 9
  • 30
19
votes
1 answer

Exclude SwiftUI previews from code coverage?

I'm having trouble getting my code coverage up to min. 90% because XCode takes the PreviewProvider into account. What should I do? Remove all the SwiftUI previews? Or is there a way I can exclude some lines with 'PreviewProvider' keywords etc. Xcode…
Qingwan Kuah
  • 261
  • 2
  • 6
19
votes
2 answers

Unit tests passing through Maven, but failing through Cobertura: "Expecting a stackmap frame at branch target 65"

I recently added the Cobertura plugin to my Java/Spring-MVC project. The strange thing is that all my unit tests were passing, and they still pass when Maven does its initial test run, but then when Cobertura tries to run the tests, they all fail…
UpAllNight
  • 1,312
  • 3
  • 18
  • 30
19
votes
2 answers

What are the differences between the three methods of code coverage analysis?

This sonar page basically lists the various methods employed by different code coverage analysis tools: Source code instrumentation(Used by Clover) Offline byte code instrumentation(Used by Cobertura) On-the-fly byte code instrumentation(Used by…
Geek
  • 26,489
  • 43
  • 149
  • 227
18
votes
3 answers

cobertura-maven-plugin with Java 8

Is it just me or the cobertura-maven-plugin doesn't work with java 8? when it runs I get [INFO] --- cobertura-maven-plugin:2.6:instrument (default) @ provider-impl --- [INFO] Cobertura 2.0.3 - GNU GPL License (NO WARRANTY) - See COPYRIGHT…
Hilikus
  • 9,954
  • 14
  • 65
  • 118
17
votes
2 answers

Is there still no solution for ignoring setter/getter (other trivial methods) with the cobertura-maven-plugin?

Did someone find a good solution to ignore trivial methods? Using some automated testing like Unitils is not really an option, since the code-coverage should not go up if only getters/setters are tested! Using cobertrua-maven-plugin version…
16
votes
1 answer

Exclude specific methods from code coverage from cobertura?

I was trying to ignore all the toString() methods from instrumentation using following configuration. This wasn't really working? This is using cobertura as maven plugin. This was based on a previous answer Exclude methods from code coverage with…
chinto
  • 1,486
  • 17
  • 27
15
votes
2 answers

Is there a way to convert a Cobertura XML into an HTML report?

I have a XML file generated in a test. Is there a way to convert it to a HTML report ala Jenkins?
Leprosy
  • 1,085
  • 4
  • 14
  • 36
14
votes
2 answers

How to output coverage XML with nosetests?

I'm trying to output the coverage XML of my nosetests so they show up on Hudson. The line I'm executing is: nosetests --with-gae -v --all-modules --with-xunit --with-coverage I see the coverage output in the console, but there's no xml file…
Cuga
  • 17,668
  • 31
  • 111
  • 166
14
votes
2 answers

How does Cobertura work with JUnit?

I can't understand how Cobertura cooperates with JUnit. As I understood cobertura modifies compiled byte code and inserts in this byte code its own commands. Ok. After that we run Junit framework and give it our tests to run. Could anyone explain at…
Pavel_K
  • 10,748
  • 13
  • 73
  • 186
14
votes
6 answers

Java code coverage in Hudson

I'm migrating a couple of projects from an ant build to a maven one. The build server is , and will remain, Hudson. I've been having trouble recording code coverage in hudson with cobertura due to the tests run and recorded twice problem. The…
Robert Munteanu
  • 67,031
  • 36
  • 206
  • 278
13
votes
1 answer

How do I correctly integrate Maven, Jenkins, Sonar and Cobertura?

hope someone can help. our project is an Eclipse plug-in project we have a Jenkins server our project uses Maven and Tycho (for plug-in projects) for build management we installed a Sonar server we integrated Sonar into Jenkins by using the Jenkins…
danowar
  • 675
  • 1
  • 11
  • 21
1
2
3
43 44