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

Web Application Code Coverage using JaCoCo

I have been assigned a task where I want to generate the code coverage report of web application execution (development code) when a manual or automation test script is executed, I have to identify (using any tool) what percent of development code…
0
votes
0 answers

Classes and methods not getting ignored in Jacoco coverage report

I wrote a custom annotation to ignore classes and methods while generating Jacoco coverage report. Please refer to code below: @Target({ElementType.TYPE,ElementType.METHOD,ElementType.CONSTRUCTOR}) public @interface ExcludeFromJacocoGeneratedReport…
Prakhar
  • 41
  • 6
0
votes
0 answers

Junit test cases give InvocationTargetException with Java11 on graviton machines

I have been facing very weird issue where my unit test cases fail on arm graviton aws machines. The same unit test cases pass on intel machines with Java8 I am getting the below errors: Exception in thread "main"…
Mrugesh
  • 4,381
  • 8
  • 42
  • 84
0
votes
0 answers

JaCoCo report showing 0% for excluded classes

I'm trying to integrate jacoco with jenkins. For now, whenever there's a push, jenkins detects and runs the jenkins file, where I have a stage for JaCoCo, that looks as follow and working: if(runJaCoCo){ stage('JaCoCo'){ jacoco( …
0
votes
1 answer

build not failing when code coverage is below specified value

I want my build to fail if the code coverage is below 90%. In order to do that, I created the jacocoTestCoverageVerification task to my build gradle. jacocoTestCoverageVerification { violationRules { rule { limit { …
0
votes
0 answers

Exclude classes from JaCoCo coverage report on multiple levels

I have a multi-module gradle project configured with convention plugins. I'd like to be able to exclude classes from the code coverage report both in the convention plugin and in the module level build script. Here are the relevant files from the…
Martin Tarjányi
  • 8,863
  • 2
  • 31
  • 49
0
votes
0 answers

JaCoCo coverage reports in multi module project with surefire

I have a project with multiple modules. module1 module2 module3 testModule: src/main/java: com.example.test some legacy I cannot get rid of src/test/java: com.example.test: actual test classes pom.xml (in testModule) pom.xml(root…
0
votes
1 answer

How to exclude generated code from jacoco coverge report?

I have a maven project and the below step is mentioned right after executing surefire tests(for JUnit) and failsafe (for Integration tests). However, I am not able to exclude the files from generated-sources folder. However, if I use a single…
0
votes
1 answer

Jacoco coverage over ternary operations

I faced a frustrating problem with jacoco and ternary operations in Java. Context: I have a function which take a List. The max filters this list can have is 10 and they can be set or not. I choosed to do ternary to fill the filters…
0
votes
1 answer

Is there a way to get rid of > Warning: [io.quarkus.config] Unrecognized configuration key "quarkus.jacoco.excludes" was provided; it will be ignored

Using Quarkus 2.14.2.Final, with quarkus-maven-plugin and quarkus-jacoco. pom.xml: ... io.quarkus quarkus-jacoco test ... In application.yml…
0
votes
0 answers

How do I fix this crash in Eclipse when launching any test as a coverage configuration?

Here is the unit test causing crashes on all others unit tests when launched as coverage configuration : public class JiraBcel362TestCase extends AbstractTestCase { @Test public void testProcessConstantPoolWithCondyEntry() throws…
Sybuser
  • 735
  • 10
  • 27
0
votes
0 answers

Attaching Jacoco agent to a running JVM by agentmain

I found that jacoco only supports two startup methods, offline and javaagent, but the project requires me to use jacoco to attach a running jvm. Is there any way to achieve it? When looking at the jacoco source code, I saw that CoverageTransformer…
FJ-FJ
  • 1
0
votes
0 answers

Android: How to configure JacocoReport to not instrument classes again

I'm getting coverage reports from the Android tests (instrumented tests). I'm using the gradle plugin and have set the flag isTestCoverageEnabled true. At CI I run tests using ADB (not gradle) and this generates the .ec files. I need to generate…
png
  • 4,368
  • 7
  • 69
  • 118
0
votes
0 answers

Unable to get html, csv and xml report from merged jacoco.exec by running report-aggregate goal after merge goal with verify phase

The whole structure of application is like there a root pom, there are n number of modules and I have created one aggregator module. This is how my pom.xml for the aggregator sub module looks like.
Ashish khare
  • 110
  • 6
0
votes
0 answers

Get Jacoco coverage report from system app (android:sharedUserId="android.uid.system")

I have an android application created for custom ROM where I install it as a system app by giving android:sharedUserId="android.uid.system". I have integration Jacoco to the project to get the coverage report I can get the coverage when I remove…