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

How do I make jacoco take into account the coverage of what is run by tests as Runtime.exec(...) or ProcessBuilder(...).start()?

I have unit tests that generate runnable classes with a main class, compiles them and execute them as part of the test with Runtime.getRuntime().exec("java", "-cp", ..., "Main", ...) or new ProcessBuilder("java", "-cp", ..., "Main",…
Sybuser
  • 735
  • 10
  • 27
0
votes
1 answer

Gradle jacoco plugin: how to print the location of the HTML report at the end of the task execution?

I added the jacoco aggregation plugin to my build plugins { id("jacoco-report-aggregation") } When I run the task ./gradlew testCodeCoverageReport, the report is correctly generated in build/reports/jacoco/testCodeCoverageReport/html/index.html…
apflieger
  • 912
  • 10
  • 18
0
votes
1 answer

Rename jar and it's classes

I want to run multiple jacoco javaagents on the same target with tcp ports. This causes an issue due to a naming conflict. My thought is to rename the jacoco_agent.jar to jacoco2_agent.jar including all the class names. I already tried jarjar, but…
0
votes
0 answers

How to include dependency classes for jacoco test coverage report?

We have multiple repositories for different purposes and generated jars are used in main(deployable) repo. We have project-core-logic repo and its jar added as dependency in deployable-main repo. And we only have test cases in deployable-main repo…
Tushar Tambe
  • 115
  • 1
  • 8
0
votes
1 answer

Unable to get report from Jacoco gradle Kotlin project on SonarCloud

Right, so I have a Kotlin Gradle project with the framework SpringBoot. The project is on GitHub and our CI system is Circle CI. At the build.gradle.kts file we have the following configs: sonarqube { properties { …
Lavínia Beghini
  • 165
  • 1
  • 11
0
votes
0 answers

Jacoco CLI classes not matching with execution data

I am trying to generate a coverage report of an application while it is executing using Jacoco CLI. I am first running: java -javaagent:$wd/jacocoagent.jar=destfile=./scripts/petclinic-benchmarks/results/jacoco.exec -jar…
griz
  • 119
  • 7
0
votes
0 answers

Jacoco test coverage report is not generated

I have configured the maven jacoco plugin as follows in my pom.xml file org.apache.maven.plugins maven-surefire-plugin ${surefire.version}
nikator
  • 1
  • 2
0
votes
0 answers

Merge jacoco.xml and jacoco-it.xml reports into one report for github actions

In my JHipster service (single module project) I`m generating separate jacoco.xml for my unit tests suite and separate jacoco-it.xml report for integration tests. I have tried to use report-aggreagate goal, but it was producing XML w/o any valuable…
Artyom
  • 25
  • 5
0
votes
1 answer

Partially covered test cases for case class in scala

I have a case class defined as below case class Person(name:String = null) Below is the test case for this case class. import org.scalatest.FunSuite class PersonTest extends FunSuite{ test("Person test"){ val personName=Person("Bill") …
Dileep Dominic
  • 499
  • 11
  • 23
0
votes
0 answers

exclude parent class code from jacoco coverage report?

is there a way to exclude code lines of all parent classes from jacoco coverage report without changing the code of the parent classes? I'm using gradle. Thanks!
user2328609
  • 21
  • 1
  • 2
0
votes
0 answers

How do I get my Jacoco Test Coverage Report to open automatically when jacocoTestCoverageVerification fails?

I have configured Jacoco successfully in my project, but I'd like to have my test coverage report open automatically when the test coverage verifications rules I set up fail. Would I have to use gradle tasks to do that, or is there an out of the box…
Max G
  • 125
  • 1
  • 6
0
votes
0 answers

Disable coverage percentage rounding for Jacoco

I use Jacoco to generate a code coverage report. BUT in the resulting html report, all percentages are rounded to an integer. How do I specify the setting so that the percentages are two decimal places? my example of using the plugin:
Ilya Y
  • 744
  • 6
  • 24
0
votes
0 answers

How to publish test report in Jenkins dashboard?

My application have unit test and integration test and I'm trying to publish its reports in Jenkins dashboard. I'm able to generate the reports and they appear here. If I open them the test results are there. My problem is that I want them to be…
0
votes
1 answer

How can I fail the pipeline if the code coverage is below 70%, in azure devops

We are using springboot, Jacoco, and azure devops, we need to break the pipeline if the percentage of code coverage is less than 70%, how can I achieve this with azure pipeline. Kindly suggest.
0
votes
0 answers

Unable to run test cases individually on local system - Error : Jacoco - ": org.jacoco.agent.rt.internal_6da5971.Offline"

Test cases get run on mvn install but when I try to individually run ith through Intellij Idea, the i get the error of jacoco offline. dependency : org.jacoco.agent - 0.8.7 classifier as runtime and scope as test added plugin…