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
8
votes
1 answer

Sonar Cobertura Plugin not finding coverage.xml file

I have a multi-module maven project in Jenkins 1.545.I am using Sonarqube version 4.2.I have installed cobertura plugin version 1.6.1 and java plugin version 2.2.1 in Sonarqube.I have successfully generated coverage.xml file at location-…
user3472205
  • 81
  • 1
  • 1
  • 3
8
votes
4 answers

How to change value of name column in cobertura report

I am using cobertura plugin in jenkins for code coverage. I want to change value of name column in Project Coverage summary on a per-report basis. Is there any way to change this. I want to give my project name over there.
Prithvipal Singh
  • 511
  • 4
  • 9
  • 23
8
votes
6 answers

Cobertura ant script is missing Log4J classes

I tried to get Cobertura running inside my ant script, but I'm stuck right at the beginning. When I try to insert the cobertura taskdef I'm missing the Log4J libraries. Ant properties & classpath
cringe
  • 13,401
  • 15
  • 69
  • 102
8
votes
0 answers

eCobertura and dbunit don't find persistence.xml for tests

I have a couple of dbunit-tests for a jee5-project. They work great when I try to run them with "run as TestNG test" in Eclipse. But when I try to run them as "Cover as TestNG test" they fails with the error "javax.persistence.PersistenceException:…
Roland
  • 5,328
  • 10
  • 37
  • 55
8
votes
3 answers

What are my alternatives for test code coverage on Android?

I know Android's Ant tooling comes with built-in Emma code coverage, but Emma's reports look more and more dated and cannot be easily integrated into other coverage reports or even Sonar, basically because Emma lacks a detailed XML reporting format.…
Thomas Keller
  • 5,933
  • 6
  • 48
  • 80
8
votes
3 answers

double unit test reporting with hudson and maven

I have a maven2 project in hudson and when the cobertura reporting plugin runs, it causes the unit tests to show that they have run twice. I don't mind them running multiple times, but the trend graph shows twice as many tests as we actually are…
Jeff Storey
  • 56,312
  • 72
  • 233
  • 406
8
votes
3 answers

Jenkins Cobertura plugin "Source code is unavailable"

I'm using Jenkins ver. 1.466 with Jenkins Cobertura Plugin ver. 1.5. I generated coverage report for Django project. All charts looks good, but when I want to see source code I have warning message: Source code is unavailable. Some possible reasons…
7
votes
3 answers

Cobertura code coverage is 0% when using Maven 3

After reading this: What is the proper way to use Cobertura with Maven 3.0.2 and this: http://www.wakaleo.com/blog/292-site-generation-in-maven-3 my POM file looks like this: .....
Arek
  • 1,941
  • 4
  • 22
  • 27
7
votes
3 answers

GitLab test coverage visualization is not working on a simple example

I have created a very simple example: https://gitlab.com/mvfwd/gitlab-coverage. Unfortunately gitlab does not show Cobertura coverage visualisation. Here is my .gitlab-ci.yml: image: python:3 stages: - test coverage: stage: test script: -…
mvfwd
  • 141
  • 2
  • 9
7
votes
2 answers

Show code coverage with a source code in Jenkins wiht Cobertura (run result from other machine)

Background I have large c++ application with complex directory structure. Structure is so deep that code repository can't be stored in Jenkins workspace, but is some root directory, otherwise build fails since path length limit is busted. Now since…
Marek R
  • 32,568
  • 6
  • 55
  • 140
7
votes
6 answers

Generating a maven site including a Cobertura Report

I've got some projects that are already doing site generation via maven, and I want to integrate cobertura reports in them, but no maven goal I seem to run will generate a local preview for me to look at that includes the Cobertura reports in the…
Trampas Kirk
  • 1,436
  • 3
  • 16
  • 21
7
votes
1 answer

dotnet cli - specified .runsettings file not used in code coverage run

I have a solution containing two dotnet core 2.1 projects (c#). The first is a console application The seconds is a test project with unit tests I generate code coverage stats about project 1 when executing tests in project 2 using this…
Rob
  • 6,819
  • 17
  • 71
  • 131
7
votes
2 answers

Cobertura on Tomcat

I'm trying to apply code coverage using Cobertura. The app is deployed in Tomcat 5, but when I instrument the .class files, the app stops working. This are my steps: Compile the app (This run in tomcat) Instrument the class…
Gareve
  • 3,372
  • 2
  • 21
  • 23
7
votes
2 answers

Maven - Tweaking the phase where to run a plugin declared in the reporting section

I am trying to tweak the phase when a maven plugin execution will run in maven-2. My specific issue is with attempting to run the cobertura:instrument step bound to the lifecycle phase process-test-classes, so that it doesn't conflict with other…
Carles Barrobés
  • 11,608
  • 5
  • 46
  • 60
7
votes
2 answers

Why does Cobertura fail to report assert branch path was covered?

In Cobertura, I can not get it to report that the conditional path of an assert statement was taken. Is this a known limitation? I have a JUnit test that expects and AssertionError to be thrown, and it passes correctly. The problem is that Cobertura…
cmcginty
  • 113,384
  • 42
  • 163
  • 163