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
10
votes
3 answers

Grails / Cobertura report - conditional coverage doesn't make sense

What could cause something like this: The line def result shows only 2/6 branches covered, even though it has NO BRANCHES, while the following line, which actually has a conditional, is ok. What's going on? I verified that the cobertura.ser is…
wrschneider
  • 17,913
  • 16
  • 96
  • 176
9
votes
1 answer

How do I configure when cobertura tests run in maven-cobertura-plugin?

In order to fine-tune which tests are run at which times and in which environments, we have several executions set up for the maven-surefire-plugin. We set the default configuration to skip all tests, then enable them for the executions we want. …
CPhelps
  • 279
  • 1
  • 3
  • 7
9
votes
2 answers

Jenkins Build Failure, Cobertura Error

I tried to build a job and it returns following error: > Failed to execute goal > org.codehaus.mojo:cobertura-maven-plugin:2.7:instrument (default-cli) > on project addressbook: Execution default-cli of goal >…
Aarit Soni
  • 101
  • 1
  • 4
9
votes
1 answer

Cobertura : how to cover spring-data @Repository interfaces

Regarding following information : https://stackoverflow.com/a/14601831/704246 Cobertura does not instrument interfaces I'd like to know how to add spring-data interfaces to coverage results, since @Repository implementation classes are only…
Saad Benbouzid
  • 502
  • 6
  • 16
9
votes
2 answers

Jenkins Cobertura plugin not finding the coverage.xml file

I have a multi-module maven project in Jenkins 1.502 with the jenkins-cobertura plugin version 1.9.3. My cobertura.xml file is generated in the web-app module and I can see it when I browse the workspace of my project in Jenkins. I've tried…
doug78
  • 197
  • 1
  • 2
  • 12
9
votes
2 answers

Maven Cobertura OutOfMemoryError

I am using Maven site:run to generate a cobertura code coverage... The following is my pom.xml configuration for cobertura: ... org.codehaus.mojo
KrishPrabakar
  • 2,824
  • 2
  • 31
  • 44
9
votes
3 answers

How to get Cobertura to fail M2 build for low code coverage

I'm trying to configure my WAR project build to fail if the line or branch coverage is below given thresholds. I've been using the configuration provided on page 455 of the excellent book Java Power Tools, but with no success. Here's the relevant…
Andrew Swan
  • 13,427
  • 22
  • 69
  • 98
9
votes
1 answer

Code Coverage with Jenkins

I am being asked to use Jenkins to test code coverage for a Java Project. The issue is I have never used Jenkins and have scarcely little experience with actual code coverage. I have been searching a bit and I have come across JaCoCo and Cobertura…
EasilyBaffled
  • 3,822
  • 10
  • 50
  • 87
8
votes
2 answers

How to make maven cobertura and surefire plugins work together?

I put the surefire and cobertura plugins in my pom.xml, but I can't configure them to work fine. Or cobertura doesn't run or the tests are executes twice. So, how could I configure the plugins for they run together and just one time? If I configure…
joaosavio
  • 1,481
  • 3
  • 17
  • 20
8
votes
3 answers

How do I make Jenkins, Sonar and the JaCoCo plugin work together for Eclipse Tycho Plugin Projects (or maybe Cobertura)?

my setup is: Jenkins 1.448 Sonar 2.13 Jenkins Sonar Plugin 1.72 a MySql database for Sonar I have the following project: Eclipse Plugin Project using Maven multiple modules (parent maven project, source plugin project, test fragment project) a…
danowar
  • 675
  • 1
  • 11
  • 21
8
votes
1 answer

Unit testing slow with Cobertura

I recently integrated Cobertura into my Ant build scripts and I am wondering if I did it correctly because it has significantly slowed down the time it takes to run the unit tests. Here is a sample console output: ... [junit] Running…
Sarah Haskins
  • 1,355
  • 2
  • 16
  • 25
8
votes
2 answers

Property cobertura is not allowed - gitlab-ci.yml

In our gitlab-ci.yml file, we have include reports in our testing stage from cobertura. The yml worked fine up until a few days ago, and although literally nothing has been changed on the yml file, it is now being rejected as invalid. The error is…
AndyMcGN
  • 373
  • 3
  • 8
8
votes
4 answers

Maven cobertura plugin - one report for multimodule project

I'm using maven cobertura plugin to report code coverage in my multimodule project. The problem is that I don't know how to generate one report for all modules in project. So far I have generated separate reports for every module, but it would be…
Lukasz Moren
  • 1,625
  • 2
  • 15
  • 16
8
votes
3 answers

ERROR SLF4J: Class path contains multiple SLF4J bindings jenkins cobertura maven

I'm with this error on third day already and I can't resolved. There is something that I can't grasp on and no matter what I do the error still persists. I'm reading a book called "Jenkins a definitive guide"…
Pavel Nichita
  • 93
  • 1
  • 1
  • 4
8
votes
2 answers

Cobertura gives Argument list too long

I am trying to generate code coverage reports using cobertura plugin. I have this dependency in my pom.xml org.codehaus.mojo cobertura-maven-plugin 2.6
user2973475
  • 357
  • 1
  • 3
  • 12