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

Cobertura exclude vs ignore

I see that in the cobertura-maven-plugin, I can configure my instrumentation with both excludes and ignores. What is the difference between these two?
Mark
  • 4,970
  • 5
  • 42
  • 66
13
votes
3 answers

Lombok annotations vs code coverage in Cobertura or similar tool

Configure cobertura to ignore certain blocks of code From what I have read from above question, there's no way in Cobertura to exclude given code part from being tested versus having coverage in tests. Is that true? / Is it possible in any…
dantuch
  • 9,123
  • 6
  • 45
  • 68
12
votes
3 answers

Publish a pipeline Azure Devops code coverage report

I am trying to publish a detailed report online in my Azure DevOps Pipeline, but all I got is a link to download this Coverage file. (That can not be read anymore with the community version since the Visual Studio 2019) This is my…
12
votes
5 answers

How do I get Emma or Cobertura, with Maven, to report coverage on source code in other modules?

I have a multi-module Maven setup with Java code. My unit tests, in one of the modules, exercise code in multiple modules. Naturally, the modules have inter-dependencies, and code in all relevant modules is compiled as needed in advance of test…
Joshua Fox
  • 18,704
  • 23
  • 87
  • 147
12
votes
7 answers

Measure Code Coverage only on New Code

We are looking for a creative way to measure code coverage on new code separate from existing code. We have a large legacy project and want to start getting 90+% coverage on any new functionality. We would like a way to easily view a report that…
Andy
  • 121
  • 1
  • 3
12
votes
3 answers

Spring @Autowired fails in case of Cobertura instrumented class

Question Cobertura instrumentation is breaking springs autowiring in a specific case. Does anyone know how to resolve this? Scenario I am running MVN 3.0.4 with the cobertura-maven-plugin version 2.5.1. mvn test runs without issues mvn compile,…
elyzion
  • 133
  • 2
  • 8
11
votes
4 answers

How to view HTML coverage report using Cobertura Maven plugin?

I want to generate and view a coverage report for a Java-Maven project. I've added the following to pom.xml: org.codehaus.mojo cobertura-maven-plugin
Eric Wilson
  • 57,719
  • 77
  • 200
  • 270
11
votes
3 answers

cobertura in eclipse

I just installed ecobertura plugin, but it looks like not a very user-friendly tool from within eclipse. is there any good plugin for cobertura in eclipse or article to describe how to use ecobertura? I'm used to seeing code complexity and coverge…
Charbel
  • 14,187
  • 12
  • 44
  • 66
11
votes
3 answers

cobertura-maven-plugin conflicts with FindBugs

After updating cobertura-maven-plugin from 2.6 to 2.7 Cobertura plugin conflicts with FindBugs plugin. FindBugs plugin detects error in cobertura-instrumented code: [INFO] Incorrect lazy initialization of static field…
Rafał Wrzeszcz
  • 1,996
  • 4
  • 23
  • 45
11
votes
2 answers

Generate two coverage reports in a single jenkins build

I have a Jenkins build which build all my java/angularJS project. It launch testNG tests for the java part and karma tests for the javascript part. So I can generate one testNG report (for java) and one junit report (for karma test) in my Jenkins…
clement
  • 489
  • 1
  • 5
  • 18
11
votes
5 answers

Hudson "Source code is unavailable."

I'm using Hudson to continuously build a Python project. Unit tests and code coverage work great, but this message appears when drilling into the Cobertura Coverage Report for my files that are not unit tests: Source code is unavailable.Some…
Matt Norris
  • 8,596
  • 14
  • 59
  • 90
11
votes
6 answers

cobertura-maven-plugin excludes configuration

I have a Maven project with a test case DefaultViewTypeToFragmentMapperTest.java in the directory /src/test/java/test/com/mycompany/myproduct/android/viewtype2fragmentmapper/. I want this test case to be excluded from unit test coverage calculation.…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
11
votes
1 answer

Is there a tool for converting the Emma XML reports to Cobertura XML format?

I am using a code coverage tool that can only generate Emma XML report, while what I need is Cobertura or gcov format. Does there already exist some tool for doing the conversion? If not, I'm afraid I must do it myself.
tomsheep
  • 253
  • 1
  • 3
  • 7
10
votes
2 answers

eCobertura not working correctly in Eclipse

So I'm trying to test out my coverage for a Java Application in Eclipse. I installed eCobertura from the "Install new Software" dialog and successfully installed. But when eclipse starts up it throws me this error, and I get another Initialization…
CrazyBS
  • 616
  • 1
  • 6
  • 11
10
votes
5 answers

Ignoring report generation for specific classes in cobertura maven plugin

I've been using Cobertura plugin for report generation and instrumentation (with surefire). Here is the issue I am facing: I am unable to make the plugin ignore report generation for specific classes in my project. PF below the related excerpt…
Neeraj
  • 8,408
  • 8
  • 41
  • 69
1 2
3
43 44