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

How to check that the code/test-coverage of cobertura.xml files is above a specified threshold?

I have a .Net 5 solution with multiple projects and multiple test projects. I want to make sure either everything or a specified percentage value (e.g. 80%) got covered by tests. I'm using xUnit for my tests and created the following Powershell…
user13755987
4
votes
1 answer

Karma doesn't wait for build to finish before starting to test

After configuring karma to use cobertura and trx it does no longer wait for build to finish before attempting to start testing. As a result this drowns out any error messages I can get from the build process, which means if I get an error in one of…
Stevie
  • 157
  • 12
4
votes
0 answers

No cobertura code coverage in SonarQube, Azure DevOps displays it right

We have a product written in Java that is built using Azure DevOps. The issue being faced is SonarQube showing 0.0% code coverage. Azure DevOps publish code coverage task is able to pick up the results and show it in code coverage tab without any…
Chethan S.
  • 558
  • 2
  • 8
  • 28
4
votes
2 answers

Maven Cobertura: unit test failed but build success

I've configured cobertura code coverage in my pom: org.codehaus.mojo cobertura-maven-plugin 2.4
Pavel Drobushevich
  • 308
  • 1
  • 4
  • 10
4
votes
1 answer

Publishing multiple cobertura coverages with TFS CI

I have a monorepo project, created with lerna. And, I use Karma+Jasmine for the unit testing. The project structure looks as follows: |-packages | |-package1 | | |-coverage | | | |-cobertura | | | | |-coverage.xml // here goes the coverage report…
Sayan Pal
  • 4,768
  • 5
  • 43
  • 82
4
votes
0 answers

Show two coverage reports in a single jenkins build

I have a python project that houses four subprojects that kind of go together but are kept in the same github repository as they are logically separate. So my project directory structure is like below. . ├── project1 ├── project2 ├── project3 ├──…
joydeep bhattacharjee
  • 1,249
  • 4
  • 16
  • 42
4
votes
2 answers

How to merge code coverage results in VSTS

I have a Visual Studio solution with multiple projects. I have added corresponding unit test projects in my solution. I am using Cobertura in VSTS to find the code coverage for these projects. Cobertura publishes separate Cobertura.xml files for all…
Kiran
  • 747
  • 2
  • 10
  • 35
4
votes
0 answers

How to Integrate multiple unit test reports with SonarQube

I have couple of Maven projects in my build. Each project has its unit test cases. I would like to execute those test cases & report the consolidated results on SonarQube Server. I am on SonarQube 5.6. As there are multiple Cobertura reports to…
4
votes
2 answers

Code Coverage: Cobertura and SonarQube 5.3 Maven Integration

We are migrating all the project from ANT to MAVEN as part of Continuous Integration. We are using JaCoCo for new project to measure the code coverage and integrated successfully with SonarQube. We have few existing ANT project which is using…
4
votes
2 answers

How to exclude a class from Jacoco coverage?

I want to use Jacoco in a way so that it excludes a Sample.java class from the overall coverage. To achieve that I have included within prepare-agent goal in maven pom.xml Jacoco plugin:
meallhour
  • 13,921
  • 21
  • 60
  • 117
4
votes
1 answer

Code Coverage for C# / Jenkins

I'm looking for Code Coverage on Jenkins. Unfortunately I need coverage for C# projects. What I've tried until now: I'm using dotCover (over commandline) to create either html results or xml results (it's working). I tried to use "cobertura"…
Lino556
  • 133
  • 1
  • 9
4
votes
3 answers

How to avoid double compilation and testing with cobertura:check?

I'm using maven-cobertura-plugin in order to calculate code coverage in my project. As I understand, this plugin starts a new/forked build cycle in order to compile and test the code base. When it's done the plugin calculates code coverage. As I…
yegor256
  • 102,010
  • 123
  • 446
  • 597
4
votes
4 answers

Java : Which Code Coverage tool to use?

Here is what I want to do: 1) A running application has been instrumented. The byte code is clean - means that the tracing info should be added on the byte code level. 2) The running application might run for days or weeks. I want to have a trace…
user400365
  • 41
  • 1
4
votes
0 answers

Cobertura not capturing the coverage for reflective method calls

I have a webapp which makes REST calls. This webapp is bundled with cobertura instrumented classes. From the REST resource, the public service APIs are invoked using reflection (This was done to overcome some class loading issues with OSGI). Now…
Sampath
  • 41
  • 2
4
votes
0 answers

How can I get both Scala and Java Cobertura coverage?

I have a Scala project built with SBT. I use Jenkins to do my build, and include the following as a build target: scoverage:test This gets me very nice coverage reports for my Scala sources using the Cobertura plugin for Jenkins. My project has…