Ah I think I am hitting <https://discuss.gradle.or...
# community-support
v
Great that you found it, but please do not split topics across several threads. This makes following the conversation in the threads view very hard as the context of the other messages is missing. If you have additional information either edit the original message or post to its thread.
b
Sorry!
Copy code
tasks.register<JacocoReport>("jacocoTestReportParallel") {
  dependsOn("parallel")
  sourceSets(sourceSets.main.get())
}
I am setting this and I still get:
Copy code
Skipping task ':jacocoTestReportParallel' as task onlyIf 'Any of the execution data files exists' is false.
v
Well, you do not set any execution data for that jacoco task
So there is nothing to do and it rightfully is skipped
Instead you badly set a
dependsOn
Practically any explicit
dependsOn
that does not have a lifecycle task on the left-hand side is a code smell and usually a sign that you do not properly wire task outputs to task inputs.
b
Now I moved to:
Copy code
tasks.register<JacocoReport>("jacocoTestReportParallel") {
  dependsOn("parallel")
  sourceSets(sourceSets.main.get())
  executionData(tasks.named<Test>("parallel"))
}
which now fails:
Copy code
> Task :jacocoTestReportParallel FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jacocoTestReportParallel'.
> Unable to read execution data file /Users/bgabor8/git/demo/build/test-results/parallel/binary
Copy code
❯ lsd -alth /Users/bgabor8/git/demo/build/test-results/parallel/binary
Fri Sep 20 16:39:13 2024 384 B   ..
Fri Sep 20 16:39:13 2024 4.7 KB  results.bin
Fri Sep 20 16:39:13 2024 160 B   .
Fri Sep 20 16:39:13 2024 1.4 KB  output.bin.idx
Fri Sep 20 16:39:13 2024  40 KB  output.bin
v
You need to indeed give a task instance in, not a task provider, or you need to manually map the task provider to the execution data file
Like you have it, you use the actual outputs of the task as execution data
i.e. the test results directory for example
something like
tasks.named<Test>("parallel").map { it.the<JacocoTaskExtension>().destinationFile }
and remove that bad
dependsOn
b
why do I need to remove dependsOn? 🙂 is it impliedB
v
b
thanks!
Now all works! ❤️
👌 1