Skip to content

TS-48018 Pass the JaCoCo class loader options on to the profiler - #980

Merged
stahlbauer merged 2 commits into
masterfrom
ts/48018_include_no_location_classes
Sep 24, 2026
Merged

stahlbauer merged 2 commits into
masterfrom
ts/48018_include_no_location_classes

Conversation

@sewe

@sewe sewe commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Addresses issue TS-48018

The Gradle plugin builds the profiler's argument string from the jacoco task extension, but read
only its include and exclude patterns. jacoco.includeNoLocationClasses and
jacoco.excludeClassLoaders were dropped. The profiler replaces JaCoCo's own agent, so a setting
the plugin does not forward has no effect at all: a build that configured either of them was
instrumented as if it had not.

Both are now forwarded as jacoco-inclnolocationclasses and jacoco-exclclassloader, which the
agent passes on to JaCoCo.

Without includeNoLocationClasses the profiler records no coverage at all for a test JVM whose
class loader builds its own code sources, IntelliJ's PathClassLoader for one. The build stays
green and the report comes out empty, which is how this was found. Verified end to end outside this
repository: with this change the Teamscale Gradle plugin records test-wise coverage for our own
IntelliJ plug-in, 314 tests with coverage. That path additionally needs the fix in #979, but the two
changes are independent of each other and this branch is based on master.

On the unchecked test box: every test in this module is a GradleRunner functional test against a
generated fixture project. A unit test pinning the argument string would be the first of its kind
here, and I did not want to introduce a test style along with the fix. The jacoco block reaching
the agent is exercised indirectly by the existing functional tests, which depend on
jacoco.includes taking effect.

  • Changes are tested adequately
  • Teamscale documentation updated in case of user-visible changes
  • CHANGELOG.md updated
  • Present new features in N&N
  • TGA Tutorial updated
  • TIA Tutorial updated

The Gradle plugin builds the profiler's argument string from the JaCoCo task
extension, but read only its include and exclude patterns. A test task that set
jacoco.includeNoLocationClasses was therefore instrumented as if it had not,
which records no coverage at all when the test JVM's class loader builds its own
code sources. IntelliJ's PathClassLoader does, so every class of a plug-in under
test went uninstrumented. The plugin dropped jacoco.excludeClassLoaders the same
way.

Forward the two as `jacoco-inclnolocationclasses` and `jacoco-exclclassloader`,
which the agent passes on to JaCoCo.
@sewe sewe self-assigned this Sep 23, 2026
@stahlbauer
stahlbauer merged commit b1db3b5 into master Sep 24, 2026
4 checks passed
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