TS-48018 Pass the JaCoCo class loader options on to the profiler - #980
Merged
Merged
Conversation
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.
stahlbauer
enabled auto-merge
September 24, 2026 12:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses issue TS-48018
The Gradle plugin builds the profiler's argument string from the
jacocotask extension, but readonly its include and exclude patterns.
jacoco.includeNoLocationClassesandjacoco.excludeClassLoaderswere dropped. The profiler replaces JaCoCo's own agent, so a settingthe 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-inclnolocationclassesandjacoco-exclclassloader, which theagent passes on to JaCoCo.
Without
includeNoLocationClassesthe profiler records no coverage at all for a test JVM whoseclass loader builds its own code sources, IntelliJ's
PathClassLoaderfor one. The build staysgreen 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
jacocoblock reachingthe agent is exercised indirectly by the existing functional tests, which depend on
jacoco.includestaking effect.