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

Running into ArrayIndexOutOfBoundsException issues with PMD

I am trying to build a spring-boot project with pmd integrated in gradle and running into ArrayIndexOutOfBoundsException for lot of test cases. Even when I run single test case in debug mode to understand where I am hitting…
har123
  • 49
  • 6
0
votes
0 answers

Gradle Task creation option removed from Android Studio Electric Eel - | 2022.1.1 Patch 1

I have an Android Studio project in which I have plugins for Jacoco and Sonar and such for code quality. I could run these tasks by going into the Gradle task list -> Reporting and there I could see those. Some time ago, Android removed these task…
0
votes
1 answer

Unable to run JUnit 4 tests successfully when using Jacoco

We have recently upgraded our project to JDK 11 and have noticed that Surefire no longer generates the .exec file for Jacoco. Casting around for a solution, we modifier our Maven POM file to pick up the arg from Jacoco and give it to Surefire, as…
0
votes
0 answers

Can the Jenkins JaCoCo plugin produce multiple reports?

I'm building a JaCoCo report in my Jenkins pipeline: pipeline { stages { stage("One") { // build something... jacoco() } } } This works well with just the one report. But when I add a second one: pipeline { stages { …
Jorn
  • 20,612
  • 18
  • 79
  • 126
0
votes
0 answers

Jacoco Coverage Report for Instrumented Tests Include only Tested Code

Instrumented tests instantiate the app. Generating a Jacoco coverage report includes then also code that was called during the app initialization even if it was not actually called during any tests. Is there any way to disable this behavior? Or is…
0
votes
0 answers

"Unknown block type" reading JaCoCo execution data files from Android

I wanted: Code coverage to run reliably against the instrumented tests Tests to be isolated from each other I'm new to Android development, but experienced with other development and tooling. So I looked for the documented options and added the…
0
votes
0 answers

How to determine cause of missing test coverage branches in Jacoco unit test?

I'm having some trouble understanding the behaviour of Jacoco coverage testing. In particular this current case where the report not only shows 50% missing branches but also red colouration of the closing brace of an if else block. The function…
David Brown
  • 3,021
  • 3
  • 26
  • 46
0
votes
1 answer

Quarkus Jacoco coverage not working when code and unit tests are in different modules

In my Quarkus app I have 2 modules, module-api and module-impl. Unit tests for both modules are in module-impl. When I run mvn verify the report only contains coverage for code in the module-impl. Code in module-api is at 0% even though I have unit…
XuBo
  • 73
  • 1
  • 7
0
votes
0 answers

How to get coverage on code which is in a different module than tests?

I have a project with three modules api, impl and report. Report module is just for coverage report aggregation. Impl module contains tests for both api and impl modules. I managed to get coverage working correctly, when I have tests in their…
XuBo
  • 73
  • 1
  • 7
0
votes
0 answers

Jacoco Offline instrumentation Android Script

I am trying to use Jacoco Offline instrumentation in my android project to get coverage with PowerMockito. Following is my build.gradle. apply plugin: 'jacoco' configurations { jacocoAnt jacocoRuntime } jacoco { toolVersion =…
Dharsam1990
  • 121
  • 10
0
votes
1 answer

Generate Jacoco report for integration tests

I've created a new test suite called integrationTest using the jvm-test-suite plugin. Now I want to generate a jacoco report just for the integration tests. I create a new gradle task like…
kylie.zoltan
  • 377
  • 3
  • 15
0
votes
0 answers

jacoco xml report doesn't hava overall covered percentage where as html file has

When I generate the code coerage report using jacoco plugin using gradle task. The html file has percentage of code that's covered. But the xml file dosn't have any percentage. The gradle task I have in the .gradle file. jacocoTestReport { dependsOn…
user1139928
  • 131
  • 1
  • 1
  • 6
0
votes
0 answers

Is there a way to implement code coverage for an app hosted in AWS using Jacoco?

Could somebody please share if any relevant docs for the same In normal severs we add an agent,is it the same for AWS as well?
0
votes
0 answers

On Gitlab jacoco maven plugin not creating report or folder

I have a maven build with a jacoco plugin to measure coverage. This works locally and creates the report as expected. I then wanted to pull the report into gitlab and included the file as an artifact. This never worked though and using script…
Andy Stannard
  • 1,673
  • 2
  • 18
  • 32
0
votes
0 answers

Trying to generate for multiple projects but getting jacocoTestReport SKIPPED

Expected Behavior jacocoTestReport work Current Behavior jacocoTestReport SKIPPED Context I created a task whose type is Test, and jacocoTestReport depends on the task. When I ran the task, jacocoTestReport did not work and I got the following…