Skip to content

TS-46356 Gradle plugin: Make the default excludes match Mockito mocks and Guice fast classes - #1003

Merged
DreierF merged 2 commits into
masterfrom
ts/46356_fix_default_excludes_for_generated_classes
Nov 4, 2026
Merged

DreierF merged 2 commits into
masterfrom
ts/46356_fix_default_excludes_for_generated_classes

Conversation

@stahlbauer

@stahlbauer stahlbauer commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Addresses issue TS-46356

The Gradle plugin's default JaCoCo excludes *.MockitoMock.* and *.FastClassByGuice.* never matched. JaCoCo matches excludes against the JVM internal class name, in which these generated classes are joined by $ (com/x/IFoo$MockitoMock$123, com/x/Foo$$FastClassByGuice$$abc). So the profiler instrumented every Mockito mock, and the testwise coverage report warned "Found coverage for N classes that were not provided".

Changes

  • The two default patterns now use $: *$MockitoMock$* and *$$FastClassByGuice$$*.
  • TeamscalePluginDefaultExcludesTest applies the plugin and checks the excludes the way JaCoCo's agent does: both generated classes match, ordinary nested and anonymous classes (Foo$Bar, Foo$1) do not.
  • CHANGELOG entry.

Notes for the reviewer

  • Out of scope, noticed during triage: jacoco.excludes?.addAll(DEFAULT_EXCLUDES) throws when a build sets the excludes to a read-only list (listOf(...)), and *.ConstructorAccess likely has the same dot-separator flaw. Both deserve their own ticket.

  • Teamscale's ide/buildSrc carries a workaround for this bug (TS-46322); it can go once Teamscale uses a profiler release with this fix.

  • Changes are tested adequately

  • Teamscale documentation updated in case of user-visible changes (not needed: no documented behavior changes)

  • CHANGELOG.md updated

  • Present new features in N&N (bug fix)

  • TGA Tutorial updated (not affected)

  • TIA Tutorial updated (not affected)

🤖 Generated with Claude Code

… and Guice fast classes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d_classes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@DreierF
DreierF merged commit 3a30e6a into master Nov 4, 2026
4 checks passed
@DreierF
DreierF deleted the ts/46356_fix_default_excludes_for_generated_classes branch November 4, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants