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

Android instrumentation tests for library module coverage

I inherited an android project to setup code coverage for. Not having done much for android and almost as little in gradle, I embarked on a quest to find a helpful tutorial. As surprises go, the first few tutorials were very helpful and I was able…
10
votes
2 answers

SonarQube: Coverage incomplete on multimodule gradle project with JaCoCo

I am building a SonarQube 6.2 server which is already analyzing my Java 8/Gradle 3.3 projects. When adding JaCoCo to a multimodule gradle project, I realized that SonarQube is measuring code coverage on a "per-module" basis: If a class is located in…
sk_dev
  • 295
  • 2
  • 10
10
votes
2 answers

build.gradle with Jacoco plugin doesn't generate coverage report for integration tests

I have a build.gradle file which can successfully run unit and integration tests separately or together (with a command like gradle test integrationTest for together). Both use Junit, I'm using Gradle 3, and this isn't an Android project. A report…
micseydel
  • 381
  • 6
  • 13
10
votes
3 answers

Jacoco: unable to read execution data file, ant task

Info: java version: 1.8.0_66 ant version: 1.9.6 What I want to do: Provide a code coverage report for the server's code that is running on AWS windows 2k12 server. What I did: Stop the server completely. Put jacocoagent.jar into server's bin…
DMeng
  • 143
  • 1
  • 2
  • 7
10
votes
2 answers

How to configure default coverage runner in idea?

I know that in idea I can choose coverage runner on Run/Debug configuration like this: but then I select class in tree I see the following menu: And I cannot configure coverage runner here. Is it possible to configure coverage runner tool to use…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
10
votes
1 answer

How can I integrate Jacoco reports with SonarQube without using maven?

I used Jacoco eclipse plugin to measure unit test coverage and I was able to export a report using it. I want to integrate that report with sonar so I gave the path to it in the project properties file. My properties file looks like this # Required…
nekoMiaChan
  • 181
  • 2
  • 12
10
votes
1 answer

JaCoCo configuration when sources and tests classes are in different modules

I have a multi-module project with Gradle(2.2) + JaCoCo + Sonar. I'm using the sonar-runner plugin, and when I execute the tests, I can see in each module the test report under build/jacoco/jacoco.exec. So far so good. The problem is, I have some…
scorpfrog
  • 127
  • 9
10
votes
2 answers

Include Jacoco repots in Maven site

I've integrated the jacoco-maven-plugin in my project, based on this excellent guide: http://www.petrikainulainen.net/programming/maven/creating-code-coverage-reports-for-unit-and-integration-tests-with-the-jacoco-maven-plugin/ The Jacoco plugin…
Kristel
  • 163
  • 1
  • 1
  • 10
10
votes
2 answers

Gradle Jacoco - coverage reports includes classes excluded in configuration

I added to a project a set of sources that don't have tests and I don't want them spoil my test coverage statistics. I configured Jacoco in the next way : test { jacoco{ excludes = ['org/bla/**'] includes = ['com/bla/**'] …
StKiller
  • 7,631
  • 10
  • 43
  • 56
10
votes
2 answers

"No information about coverage per test." from Sonar with Jacoco Ant build

I'm using Ant, Jacoco and Sonar. When I run my build Sonar tells me that "No information about coverage per test." and the Sonar dashboard has my coverage results, but I cannot drill down into them to see the code. However, the HTML report generated…
Paul Grenyer
  • 1,713
  • 3
  • 30
  • 51
9
votes
1 answer

ERROR in jacoco check - The parameters 'rules' are missing or invalid

This is the error I get when running mvn jacoco:check for a maven application. Due to that, the report is not generated. [ERROR] Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.3:check (default-cli) on project Netflix: The…
Bu5to
  • 93
  • 1
  • 1
  • 3
9
votes
1 answer

Code Coverage Kotlin and Java together using Maven - Jacoco

I am using Maven plugin to generate the code-coverage with Maven Plugin as below: org.jacoco jacoco-maven-plugin
Sandeep Jindal
  • 14,510
  • 18
  • 83
  • 121
9
votes
0 answers

How to generate jacoco reports for specific module in android studio?

I am very new to this environment. I came from a native iOS background. By using this https://blog.gouline.net/code-coverage-on-android-with-jacoco-92ec90c9355e, I am successfully generating the JACOCO test reports for my unit test class in my…
9
votes
3 answers

Android Studio : Could not find org.jacoco:org.jacoco.agent:org.gradle.testing.jacoco.plugins.JacocoPluginExtension_Decorated

I am trying to add JaCoCo to my Android for Sonar Qube coverage. But upon running the commands ./gradlew jacocoTestReport I get the following error. Task :app:testAlphaReleaseUnitTest FAILED FAILURE: Build failed with an exception. What went…
Mohammed Atif
  • 4,383
  • 7
  • 28
  • 57
9
votes
1 answer

maven Jacoco: how to increase code coverage thresholds automatically

I am using Jacoco with Maven builder for my project's code coverage. I have configured rules around maximum missed classes / methods and minimum line coverage failing which maven build fails (sample below).
face
  • 1,503
  • 13
  • 27