Skip to content

Expand JaCoCo exclusion filters for generated code#1697

Open
meladRaouf wants to merge 1 commit into
mainfrom
bugfix/jacoco-filter
Open

Expand JaCoCo exclusion filters for generated code#1697
meladRaouf wants to merge 1 commit into
mainfrom
bugfix/jacoco-filter

Conversation

@meladRaouf
Copy link
Copy Markdown
Collaborator

@meladRaouf meladRaouf commented Jun 4, 2026

This PR fixs the empty JaCoCo reports

@cla-bot cla-bot Bot added the ... label Jun 4, 2026
@meladRaouf meladRaouf force-pushed the bugfix/jacoco-filter branch from 77c8a22 to 232d144 Compare June 4, 2026 09:09
exclude(fileFilter)
val compiledClassPaths = listOf(
"tmp/kotlin-classes/debug",
"intermediates/javac/debug/classes",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this support wildcards? We could just skip the whole "intermeriates/**"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried, but the coverage data disappeared from the XML report

"**/Manifest*.*",
"**/*Test*.*",
"android/**/*.*",
"**/*Dagger*.*",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do the same for any ksm/generaed code? For example retrofit.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the Room DAOs, but I don't think we need to skip everything.

@meladRaouf meladRaouf force-pushed the bugfix/jacoco-filter branch 2 times, most recently from 38b8c42 to 8b3f24d Compare June 4, 2026 09:22
@meladRaouf meladRaouf force-pushed the bugfix/jacoco-filter branch from 8b3f24d to 5c1456e Compare June 4, 2026 10:05
@meladRaouf meladRaouf marked this pull request as ready for review June 4, 2026 10:05
@meladRaouf meladRaouf changed the title Expand JaCoCo exclusion filters for generated code and refine class p… Expand JaCoCo exclusion filters for generated code Jun 4, 2026
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Jun 4, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the simprints.ci.jacoco convention plugin to broaden JaCoCo exclusion filtering (especially for generated code) and to make class-directory discovery more robust across different AGP intermediate output locations, improving CI coverage reporting reliability.

Changes:

  • Consolidates JaCoCo exclusion patterns into a single excludedPatterns list reused by both JacocoReport class filtering and JacocoTaskExtension excludes.
  • Expands exclusion patterns to cover additional generated code (Hilt/KSP, Room/KSP, Kotlin synthetic patterns, etc.).
  • Refactors class directory collection to scan multiple known compiled-class intermediate paths under build/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants