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

Why sonarqube shows different coverage for classes with the same .class files?

I have a class with @UtilityClass annotation. However, if I won't set the fields as static, sonarqube complains about 0% coverage for these fields. What is interesting, @UtilityClass annotation automatically adds static fields when it is compiled.…
user2455862
  • 585
  • 10
  • 26
0
votes
3 answers

Source file was not found during generation of report

help me understand what's wrong, please. I've worked with multi-module project and faced one problem. My architecture look like this: proj1 -src --main ---java ----com.myProj.myApi -----directories containing .java files ... // same proj2 and…
Chusya
  • 90
  • 2
  • 9
0
votes
1 answer

how to make reference type for string enum in kotlin and jacoco coverage testable

Converted a java class into kotlin in Android app, the jacoco coverage starts to show 0 coverage on a compiler generated function, which is not access able. Other ones seem fine in the report. How to make reference type for string enum in kotlin…
lannyf
  • 9,865
  • 12
  • 70
  • 152
0
votes
1 answer

Jacoco test report does not include integrationTest

I have seen similar questions and tried enough yet can't get this to work. I have testset in my build.gradle file and trying to configure Jacoco test report to include my separate integrationTest build.gradle jacocoTestCoverageVerification { …
Knight Rider
  • 972
  • 2
  • 10
  • 22
0
votes
1 answer

Jacoco finds modules but doesn't run tests

When I execute mvn clean install, the tests are found but not run: ------------------------------------------------------- T E S T S ------------------------------------------------------- Running Test1 Tests run: 0, Failures: 0, Errors: 0,…
user16356851
  • 9
  • 1
  • 2
0
votes
1 answer

Jacoco test coverage in Gradle custom tasks

At my current project we Spring Boot + Kotlin app with a huge test suite, but a fraction of those tests are flaky. So, we'd like to have those flaky tests run separately from the healthy tests, to try and give devs faster feedback about healthy…
felipecao
  • 993
  • 1
  • 10
  • 23
0
votes
1 answer

Which files does jacoco-maven-plugin scan by default

What does a plain jacoco-maven-plugin, without any configuration on inclusion and exclusion analyze, as in which types of files are included into the analysis and which ones are skipped. I didn't manage to find any documentation on this if you do…
Alex Vulchev
  • 201
  • 1
  • 2
  • 15
0
votes
1 answer

Race Condition in JaCoCo merge when generating a report?

So this is something, that a colleague called a "Schroedingers Bug" - it worked fine, until something was pointed out. Something was changed and now the bug is there. And changing back didn't help - the bug is still there :-/ In our Maven project we…
CHH
  • 140
  • 1
  • 8
0
votes
0 answers

Jacoco Code coverage report generated after on Jenkins build does not respect the jacoco configurations mentioned in pom.xml

I am trying to get Jenkins to respect the jacoco code coverage configurations from the pom.xml instead of the configurations excplicitly set on the Jenkins code coverage plugin UI. If I mention exclusions explicitly on the jacoco code coverage…
coderhack
  • 1
  • 1
0
votes
1 answer

Jacoco - How to check which lines are missing coverage

I am using jacoco for Test coverage verification in a Java Library created with Gradle. I have set the verification rule to limit minimum coverage to 1.0 (100%). I have a few classes in my code which are not meeting the criteria. based on the…
AppleCiderGuy
  • 1,249
  • 1
  • 9
  • 16
0
votes
2 answers

What is `encode()` function detected in JaCoCo coverage report (for Kolin)?

Recently I upgrade my gradle from 6.5.1 to 7.0 i.e. distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-all.zip After the upgrade, I notice my test coverage dropped. After investigation, I found out that in Gradle 6.5.1, my JaCoCo…
Elye
  • 53,639
  • 54
  • 212
  • 474
0
votes
1 answer

jacoco with both outputs: file and tcpserver

I am using eclipse 2019-12 in a JDK8 project and I want to check the coverage as I am using a web application through web Browser. For this I have configured Tomcat Server 8 in eclipse and launched with two options (both…
inquirymind
  • 135
  • 1
  • 11
0
votes
0 answers

jacocoTestReport not being generated on Jenkins

I am working on the SonarQube code coverage...I have implemented locally and able to see jacocoTestReprt and all other necessary files...but when I run the task on Jenkins jacoco not able to generate any files. In app/build.gradle task…
Girish
  • 2,196
  • 2
  • 18
  • 24
0
votes
1 answer

Android studio, how to read the code coverage result

Using Android studio to run coverage test, I got this result: For some of the class, there are tests run through all possible code path in the class, but still the result does not show 100% in either the "Method, %" or "Line, %". How to read the…
lannyf
  • 9,865
  • 12
  • 70
  • 152
0
votes
1 answer

Reporting coverage to sonarqube configured with cobertura from gradle

My sonarqube server version 8.3.1 has the cobertura plugin enabled for showing cobertura coverage reports. Now I want to report jacoco XML-coverage data (generated with gradle jacoco plugin) and its not working. Are there any known issues between…