Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

JaCoCo coverage metrics changed by enabling Sentry `tracingInstrumentation`

Open
#763 14 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, kotlin

Research direction

The issue names no repository files or tests; start by reproducing the Android unit-test coverage comparison with tracingInstrumentation enabled and disabled using the reported Gradle, AGP, Sentry, and JaCoCo versions. Compare the JaCoCo reports to identify the instrumentation effect, then confirm that the default tracing instrumentation no longer changes coverage.

Written by the indexing model from the issue text.

Description

Android Improvement se-ds
Integration

sentry-android

Build System

Gradle

AGP Version

8.5.0

Proguard

Enabled

Version

7.14.0

Steps to Reproduce

(opening on behalf of a customer)

  1. Run unit test suite, measure coverage with JaCoCo without Sentry instrumented [customer is using Jacoco 0.8.7]
  2. Instrument Sentry, using the default Sentry gradle plugin settings [waiting to confirm which version of AGP customer uses], and rerun unit test suite. Coverage of the unit test suite drops by 15%:

Customer:
The total # of lines seen by Jacoco is approx. the same, but we see a large shift from "covered lines" <--> "missed lines"
Jacoco includes all the classes as part of the "Sessions" in the report, but I dont see any new Sentry-related files classes there, at least nothing with sentry in the package, so it might be something else going on. It's a little tricky for me to more interesting analysis with my current setup (i.e. look for patterns of what classes/lines are no longer covered).

  1. disable tracingInstrumentation per https://docs.sentry.io/platforms/android/troubleshooting/#auto-instrumentation-issues. Rerun unit test suite, it is back to the same coverage number as in step 1

Customer:
Confirming that adding tracingInstrumentation { enabled = false } to our gradle setup fixes the coverage issue

Expected Result

Expected result is that default Gradle tracingInstrumentation should not affect test coverage.

Actual Result

Unit test coverage drops by 15%, which we do not want. Is there an alternative to keep coverage normal, other than disabling tracingInstrumentation?

Dominant language
Kotlin
Stars
184
Forks
41
Avg merge
1d 23h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-android-gradle-plugin

All issues in getsentry/sentry-android-gradle-plugin

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.