Questions tagged [jacoco]

JaCoCo a coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

JaCoCo is an EPL-licensed, open-source code coverage analysis tool. It runs as a JVM Agent and therefore does not require offline instrumentation.

Compared to Cobertura, it has lower runtime overhead but less precision. It is unable to record hit counts, it only records red/green, however it can show coverage on class, method, line, complexity, branch and instruction level. It also has the ability to merge the results of multiple analyses when generating a report.

QuickLinks:

Related Tags:

JaCoCo is the successor of the EclEmma Eclipse plugin for the Emma coverage tool. If a search through -tagged questions doesn't help, try searching for the tag.

The tag is used for general topics related to code coverage measurement.

1891 questions
0
votes
1 answer

How to include the Catch block in code coverage : JaCoCo and Junit

I'm quite new to Junit and JaCoCo. I'm trying to add test case for the catch block. But my JaCoCo code coverage is still asking me to cover the catch block in code coverage. Following is my method and testcase. public Student addStudent(Student Stu)…
0
votes
1 answer

Ant Vs Gradle Jacoco code coverage differs

We have migrated from ant Build tool to Gradle and also upgraded 0.7.4 jacoco version to latest 0.8.6 version. I observed that the jacoco Reports are slightly lowered (~1%) in Gradle-6.6.1 build compare to Ant-1.7.0 as seen below. compileJava { …
Swapnil Kotwal
  • 5,418
  • 6
  • 48
  • 92
0
votes
1 answer

Why is Jacoco merge not including files?

I have a multi-module maven project, and trying to use Jacoco to generate an aggregated report, and run 'aggregated' checks. However, I cannot in any possible way get the Jacoco merge function to work through the maven plugin. Therefore I tried to…
0
votes
0 answers

how could let sonarqube pickup jacoco test coverage report

I have gradle project which use jacoco plugin plugins{ id 'jacoco' id 'org.sonarqube' version '3.0' } test{ exclude 'xx' } jacocoTestReport{ dependsOn test reports{ xml.enabled true csv.enabled false …
lee
  • 53
  • 1
  • 6
0
votes
1 answer

Jacoco coverage with Ant throws java.lang.instrument.IllegalClassFormatException: Error while instrumenting class

I integrated Jacoco with my Ant build. When I run the build, the test case is executed successfully followed by the below exception in my TEST-com.worker.ManagerTest.xml. When I add excludes="*" the error is not thrown. But the jacoco.exec is…
Sat
  • 51
  • 2
  • 7
0
votes
1 answer

DateTimeFormatter.ofPattern(...) returns null on jenkins, while locally it works

When we run test on Jenkins with Jacoco coveradge tool, two tests that worked locally on IDE failed on Jenkins. Jenkins Stacktrace java.lang.NullPointerException: formatter at java.util.Objects.requireNonNull(Objects.java:228) at…
crush84
  • 21
  • 3
0
votes
1 answer

How to exclude test classes form Coverage Analysis using Jacoco

I have some test to check my code. I have generated my report in sonarcloud but I have a problem: The coverage percentage takes into account also the test classes, that are obviously uncovered by other test. Is there any option just to take into…
0
votes
1 answer

maven jacoco plugin reports always show 0% of coverage

JaCoCo reports always shows 0% of coverage but Intellij integrated report is ok. I already see others StackOverflow questions but none helped. Below is my jacoco-plugin and surefire-plugin snnipet from pom.xml configuration: EDIT:
0
votes
0 answers

Can't exclude classes and packages from Jacoco test coverage report (IntelliJ)

I can't get over the certain problem My sudoku app consist of the model classes responsible for app logic (they are in model package) and gui classes responsible for displaying sudokuBoard form on the screen (they are in gui package). I want to…
Vader20FF
  • 271
  • 2
  • 9
0
votes
1 answer

How to generate a JaCoCo report with JUnit platform launcher?

I am currently building automated tests which will be generated dynamically in their own class (e.g. TestClass1234567890.class). From those tests (which I will run with the JUnit Platform Launcher) I want to generate a JaCoCo rapport. Whenever I…
0
votes
0 answers

jacoco code coverage report includes maven dependencies in addition to the application code

I have a jacoco agent that is attached to a webservice. I executed my automation test cases and extracted the jacoco-client.exec from the webservice using the ExecutionDataClient. Now I am trying to generate a jacoco report for the webservice using…
Kishore Mohanavelu
  • 439
  • 1
  • 6
  • 17
0
votes
2 answers

How to configure build.gradle using Junit5 and Jacoco for test coverage

I am trying to configure the build.gradle file so that it supports both Junit 5 and Jacoco. I was using useJunitPlatform before, but it generates another errors. I also tried some other ways, but none can successfully generate Jacoco report. This…
Liu Hantao
  • 620
  • 1
  • 9
  • 19
0
votes
1 answer

Remove specific *directories* from JaCoCo report

I’m using JaCoCo Gradle plugin in my project. Just as an example of the question, most of my code is under package com.me.mysoftware. I’m using code generator that generate classes under…
slashms
  • 928
  • 9
  • 26
0
votes
0 answers

Cannot set the value of read-only property 'sourceDirectories' for org.gradle.testing.jacoco.tasks.JacocoReport

Using sourceDirectories and classDirectories for library org.gradle.testing.jacoco.tasks.JacocoReport, I'm getting A problem occurred evaluating project :app. Cannot set the value of read-only property 'sourceDirectories' for task…
ksv
  • 1
  • 1
  • 1
0
votes
1 answer

can't use Eclemma coverage tool with eclipse

I'm trying to use Eclemma for my project in eclipse but I get this error every time I try "coverage as" as shown here This is the error: java.lang.instrument.IllegalClassFormatException: Error while instrumenting…
Ghada
  • 1
  • 1
1 2 3
99
100