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

Kotlin jacoco coverage issue

I have the following coverage report from jacoco: This is happening after upgrading Kotlin from 1.6.10 to 1.6.20 What is the reason for this, and how can I avoid it? It seems the coverage report is simply wrong.
AmsterdamLuis
  • 341
  • 3
  • 21
0
votes
1 answer

File filter in Jacoco android test coverage report not working as expected

I am trying to add Jacoco to my project for test coverage reporting. Referred the following blogs for…
Abhimanyu
  • 11,351
  • 7
  • 51
  • 121
0
votes
1 answer

E006 Not Found Error: in scala sbt jacoco

I am trying to write some tests for my code in scala the problem is everytime i try to run jacoco with sbt I am getting all kinds of errors. I am using VSCode if that has anything to do with it This is a code snippet of the test package…
Reapr
  • 21
  • 5
0
votes
0 answers

Jacoco reports failing for maven multi module project in azure Devops pipeline

I have configured the azure pipeline for the maven multi-module project in azure Devops and Got the jacoco report error. [ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (default) on project VstsReport: An Ant…
0
votes
1 answer

merge report.xml generated by jacoco to one report

I have an android project with many modules, we run our unit tests in PRs just for changed modules, so our generated jacoco report is at the module level, but now I need a aggregated report, is it possible to merge all report.xml after…
max
  • 5,963
  • 12
  • 49
  • 80
0
votes
1 answer

Jacoco is not cover elvis operator test coverage in kotlin android project

Not able to generate test coverage for Elvis operator. I was used jacoco and kover.
Droid
  • 1
0
votes
1 answer

Jacoco shows that class declaration is not covered

I am writing test for my application. I have installed jacoco plugin for my gradle project. After making test coverage report I see "public class MyClass" in red color, that means, that it is not covered. So, how can I fix this and make it…
Lacky RyDar
  • 61
  • 1
  • 7
0
votes
0 answers

JaCoCo tests run on a jar file from pom.xml

I am trying to get the coverage of a few test cases related to an open source project of which I got the jar file. I'm using maven as automatic build tool and the jacoco plugin for maven to get the coverage of the tests on the project. What I would…
lilith
  • 63
  • 5
0
votes
1 answer

Gradle + TestNG: How to list which classes were touched by a unit test?

I'd like to list what classes are touched during the execution of each unit test. I want to discover which tests have an overly large scope and should use a smaller unit instead. Measuring the code coverage via IntelliJ or JaCoCo doesn't help me as…
fxr
  • 61
  • 6
0
votes
2 answers

##[warning]No coverage data found. Check the build errors/warnings for more details. Azure DevOps - SBT - Jacoco

I am using sbt-jacoco to calculate code coverage and would like to publish Jacoco test coverage results in Azure DevOps test reports. Here are my tasks: - script: "sbt jacoco" displayName: Run Jacoco - task: PublishCodeCoverageResults@1 …
cell-in
  • 709
  • 2
  • 11
  • 27
0
votes
1 answer

How to have 100% test coverage for function that calls invokeLater()?

I am using Junit4. This is my test class: import org.junit.Test; public class UIUtilTest { @Test public void testMultiline() { var multiLineText = "one\ntwo"; UIUtil.showError(multiLineText, "title"); assert true; …
0
votes
1 answer

Is it possible to fail "mvn package" for not meeting JaCoCo code coverage requirements?

I have included the JaCoCo maven plugin in my project's POM org.jacoco jacoco-maven-plugin 0.8.7
c_anirudh
  • 375
  • 1
  • 22
0
votes
0 answers

Jacoco 0% coverage on karate test

I am unable to figure out why coverage is 0 even though the tests run successfully I clone the Spring Boot Example https://github.com/Sdaas/hello-karate and updated the pom.xml to include Jacoco
BabyishTank
  • 1,329
  • 3
  • 18
  • 39
0
votes
0 answers

Cannot use Jacoco in IntelliJ IDEA

In my Java app, in order to generate coverage reports for my Unit Tests, I have tried several approaches to setup Jacoco as in Run with coverage or this page. However, I cannot generate coverage reports as expected and I think I need some steps…
user18085807
0
votes
1 answer

What should be the value of address argument when using jacocoagent.jar in tcpserver mode

We are trying to find code coverage of our java services using automation tests that are written in Python. We want to use jacoco for recording the coverage data using on-the-fly instrumentation. Details of setup : We have our application deployed…
Saurabh Rai
  • 45
  • 1
  • 6