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

Why is code coverage zero with Scalatest, Maven and cobertura?

I am trying to get Cobertura to work on a really simple example project with Maven and Scala. Here is my pom: EDIT: Meanwhile, I found out that this pom is rather bad. If you're looking for a better example, see the one in the accepted…
Kathi
  • 323
  • 2
  • 13
6
votes
2 answers

Coveralls not working with Travis

I'am building an app in Java with gradle as build tool. I use Travis CI and wanted to get the code coverage with Coveralls. But when grade builds my project, I get the following output: HTTP/1.1 422 Unprocessable Entity [Server: cloudflare-nginx,…
Lukas92
  • 363
  • 2
  • 11
6
votes
2 answers

Caused by: java.lang.ClassNotFoundException: net.sourceforge.cobertura.coveragedata.HasBeenInstrumented

We had installed version of our applications (without any instrumentation or cobertura jar included before generating application bundles). After installation we instrumented all the jar with cobertura, and included cobertura jar file in java…
Tejas
  • 71
  • 1
  • 2
6
votes
2 answers

Maven build causes VerifyError with java 1.7

I got one simple class with test case for it and everything works fine in eclipse, but when I run maven build (with this goals : install cobertura:cobertura checkstyle:checkstyle-aggregate) I'm seeing a Verify error in surefire report. Here is the…
Zhivko Delchev
  • 390
  • 1
  • 3
  • 15
6
votes
1 answer

cobertura report appear a lot of errors : JavaNCSS got an error while parsing the java file

[cobertura-report] net.sourceforge.cobertura.javancss.parser.TokenMgrError: Lexical error at line 29, column 59. Encountered: "\r" (13), after : "\"\u5bb8\u832c\u7ca1\u5a75\ufffd\u693f\u6769\ufffd;" [cobertura-report] at…
Yanchun Liang
  • 61
  • 1
  • 2
5
votes
2 answers

Excluding files from code coverage analysis in Azure devops pipeline

I have enabled code coverage in Cobertura format and I am trying to exclude some files (Especially 3rd party DLLs) from Code Coverage analysis in the Azure DevOps pipeline. Currently, below is the output I get in the pipeline Here 3rd party DLLs…
Tushar patel
  • 3,279
  • 3
  • 27
  • 30
5
votes
0 answers

Publish Cobertura Code Coverage XML from Jenkins to GitLab

I'm trying to find a way to publish a Cobertura code-coverage XML from Jenkins to GitLab. I've got Gitlab triggering Jenkins pipelines which generates a Cobertura code-coverage report, and currently publishes it in Jenkins. I know Gitlab supports…
Zach
  • 183
  • 1
  • 8
5
votes
1 answer

DotCover Cobertura or OpenCover XML

I have a dotcover coverage report generated using dotcover.exe. I want to integrate the report in Jenkins and show the coverage. How can I generate a cobertura or openclover xml from it?
irusul
  • 201
  • 1
  • 14
5
votes
5 answers

cobertura vs clover

We are thinking about utilizing one of these tools in our development procedure. Our environment extensively uses mvn and eclipse. Which one in your opinion is the best utility for checking test coverage? I realize that it may depend on the…
Marcin Michalski
  • 1,266
  • 13
  • 17
5
votes
1 answer

Scala ,sbt and emma or Cobertura

I want to use code coverage in Scala project,Simple Build Tool used as a build tool.What is the best one to use in this project. (I'm new to these technologies.) Any one can tell me how to configure code coverage in my project.If you could provide…
123Ex
  • 237
  • 2
  • 5
  • 9
5
votes
0 answers

CI job failing with error - Unable to execute Cobertura. Cannot run program "/bin/sh": error=7, Argument list too long

Here is the complete error failed to execute goal org.codehaus.mojo:cobertura-maven-plugin:2.6:instrument (default) on project besinapp: Unable to execute Cobertura. Error while executing process. Cannot run program "/bin/sh": error=7, Argument…
Ganga.K
  • 51
  • 2
5
votes
2 answers

Configure cobertura to ignore certain blocks of code

Is it possible using Cobertura to tell it to ignore certain bits of code that are identified by start and end comments? For example, public class Foo { public void static doSomething() { ... // Cobertura-Ignore-Start …
digiarnie
  • 22,305
  • 31
  • 78
  • 126
5
votes
1 answer

Gcov reports branches for plain function calls

I'm using gcov to get code coverage for our project, but it frequently reports 50% conditional coverage for plain function calls. It doesn't make any difference if the function takes any parameters or returns any data or not. I'm using gcovr and…
MrDanne
  • 91
  • 1
  • 5
5
votes
1 answer

How to make SonarQube module analyze the project only once when sonar analysis is bound to maven lifecycle in a multi-module project?

What I am trying to achieve is integrate SonarQube analysis into the build process, so that whenever mvn clean install is run, the code is analyzed with SonarQube. We want to use it for local analysis and also for build on Jenkins. If new issues are…
Zhenya
  • 6,020
  • 6
  • 34
  • 42
5
votes
2 answers

Output color code of Gcov with Cobertura

I have set gcov code coverage tools on Jenkins. This works fine, but I have troubles undertanding the ouput color code. The number of 'hits' of each line is corect, but some line are green when others are red, and I can't tell why. Example : Note…
MokaT
  • 1,416
  • 16
  • 37