Jacoco Report Aggregation Plugin creates dependency on included build test tasks #24303
Labels
a:bug
has:reproducer
Indicates the issue has a confirmed reproducer
in:composite-builds
including BuildIdentifier
in:jacoco-plugin
in:java-plugins
java-library, java, java-base, java-platform, java-test-fixtures
Expected Behavior
I would expect a behavior that is intuitively the same as the behavior observed on other task types and as described in the documentation ("As well as consuming outputs via project dependencies, a composite build can directly declare task dependencies on included builds. "). This means the test tasks of an included build are explicitly referenced to be considered by the plugin.
Current Behavior
When executing the test task on the main project, test tasks of an included build are not executed, only if an explicit task dependency is declared. For the Jacoco Reports Aggreation this behavior diverges from the behavior of test tasks, which leads to the case that if both tasks are executed sequentially (e.g. in a CI/CD pipeline) the execution of the Jacoco Reports Aggreation task leads to further executions of the test tasks of an included build.
Context
Included builds tasks of type Test are not executed when the test task of the main project is executed. This behavior seems to change as soon as the Jacoco Report Aggregation is applied.
Steps to Reproduce:
https://github.com/muellerml/jacoco-report-aggregation-bug-reproducer
Excecuting test task leads to following tasks being executed:
Executing testCodeCoverageReport leads to following tasks being executed (where the execution of task project2:dependency:test is unexpected from my point of view):
The text was updated successfully, but these errors were encountered: