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
0 answers

Jacoco coverage does not show any coverage for remote application

I have a server application that I run using the following command: #!/bin/bash …
Rob L.
  • 69
  • 6
0
votes
0 answers

Code Coverage drops using JaCoCo -0.8.x JaCoCo not ignoring Lombok annotations

lombok.addLombokGeneratedAnnotation = true this prop is set in Lombok.config still code coverage drops Solution I check which says to remove this prop
0
votes
0 answers

How to setup jacoco for dynamic code coverage

I am using jacoco gradle plugin and currently have a hard coded threshold as verification threshold. I want to set it up such that validation fails if the code coverage falls below master branch after a user adds some additional changes. In other…
java_doctor_101
  • 3,287
  • 4
  • 46
  • 78
0
votes
0 answers

Android: combine multiple coverage reports

I have many modules in my app ( about 500 as it is a mono repo) and I use jacoco to generate code coverage reports. So I have about 500 xml reports. I am trying to upload it to CodeCov and it has limit on the number of reports per commit. So I am…
png
  • 4,368
  • 7
  • 69
  • 118
0
votes
0 answers

Jacoco Gradle Exluding Coverage by name

I have a package co.company.microservice.configuration Inside of this package a I found: Some Configuration classes are ending as BlaBlaConfiguration.java Some DTO classes are DTO BlaBlaDTO.java Some Configuration classes are ending with Provider as…
joseluisbz
  • 1,491
  • 1
  • 36
  • 58
0
votes
1 answer

How to send Jacoco code coverage report in email from jenkins?

I have a jenkins job setup, which generated the Jacoco code coverage for my maven project. Now, I want to send this report or a summary report for code coverage to my team members every time this jenkins job is executed. Is there a plugin or any way…
0
votes
0 answers

Sonarqube: java.lang.IllegalStateException: Failed to parse JaCoCo XML report

Importing 1 report(s). Turn your logs in debug mode in order to see the exhaustive list. [sonar:sonar] Coverage report '***bin/jacoco/reports/jacoco.xml' could not be read/imported. Error: {} java.lang.IllegalStateException: Failed to parse JaCoCo…
gyanendra
  • 53
  • 3
  • 6
0
votes
0 answers

Jacoco Not covering log4j2 logs having second argument as Supplier

I am running Jacoco report over a spring boot project with gradle. I am using log4j2 for logging. Also, I am using lombok's "@Log4j2" annotation over the class. With normal logging eg: log.debug("This is a debug statement having id: {}",…
Gourav
  • 9
  • 3
0
votes
0 answers

Android Jetpack Compose code coverage report with JaCoCo?

I want to create an XML code coverage report for my unit test, but it doesn't work... I followed this plugins instructions: https://github.com/arturdm/jacoco-android-gradle-plugin I created a sample empty project with 1 Unit Test in this…
CookieMonster
  • 566
  • 2
  • 6
  • 19
0
votes
1 answer

Junit test async method call in Completable Future in Java

I have a method: public sendMessageAsync(final PublishRequest request) { final CompletableFuture responseCompletableFuture = m_serviceAClient.publish(request); responseCompletableFuture.whenCompleteAsync((response,…
alchems
  • 33
  • 3
0
votes
1 answer

JaCoCo doesn't ignore Lombok generated code

I want to test my Java code and measure the code coverage with JaCoCo. I'm using Lombok and for e.g getters or builders I get 0% code coverage. So I tried to put a lombok.config file in my root project - but nothing changed. I also tried to use…
8u3631984
  • 31
  • 2
0
votes
0 answers

Spring boot Kafka Listener Mockito Test

I have written a kafka message listener like this. @KafkaListener(groupId = "group", topics = "topic") public void consume(String message) { log.info(message); serviceProcess.process(message); } ServiceProcess{ public boolean…
Ravi Thapa
  • 79
  • 1
  • 7
0
votes
1 answer

JaCoCo with Gradle Kotlin multi-module Android project - what does isTestCoverageEnabled actually do?

I'm configuring an Android multi-module Gradle project that uses Kotlin for both the app AND the Gradle build files (gradle.build.kts). I'm using Gradle 7.3.3. First I add the Jacoco plugin to the module-level build.gradle.kts: ... plugins { …
rob
  • 6,147
  • 2
  • 37
  • 56
0
votes
0 answers

Jacoco shows All branches covered with Green mark but shows < 100% in Missed branches. What is wrong here?

I have a simple isSubClass function which takes in a List of Classes and a Throwable and returns true if any of the Classes in the list is a subclass of the throwable and false otherwise. Jacoco shows the function with a green mark saying all…
0
votes
1 answer

Android Gradle - SonarCloud Integration with Jacoco Plugin, coverage is always 0.0%

I am trying to sync my locally generated Coverage Report from Jacoco to SonarCloud, even though there are no errors, the Coverage is always 0.0%. I am able to generate a JacocTestReport.xml with an overall coverage of 86%. Below are the code…
K_Gupta
  • 21
  • 1