My bad. Missed adding:
Jacoco version is: 0.8.8 
Including it with Gradle using classpath "org.jacoco:org.jacoco.core:0.8.8"

On Monday, November 27, 2023 at 12:09:56 PM UTC+5:30 Pooja Shah wrote:

> Hi @Marc, 
> Thanks for your detailed reply here 
> https://groups.google.com/g/jacoco/c/FJ5VAOi2h0s/m/9-I-QzreAgAJ
> However I'm stuck at getting this work as in my knowledge, seeing no steps 
> in my pipeline, that would create a difference in runtime vs report 
> generation time. 
> Is there any steps/CLI tool to investigate/discover the points you 
> mentioned?
>
> On Monday, November 27, 2023 at 11:52:28 AM UTC+5:30 Pooja Shah wrote:
>
>> Hi there, 
>> [image: Screenshot 2023-11-27 at 11.42.46 AM.png]
>> I have plugged in Jacoco to capture coverage from my instrumented tests. 
>> While it's generating coverage for most of the files, at the same time 
>> for many files, it's failing with "*Execution data for* *class* 
>> <my_classes> *does not match*"
>>
>>
>> *Steps I followed:*
>>
>> Step 1: with jacoco enabled, built (which had jacocoDevDebug executed) 
>> Step 2: Save the ".class" files to refer later
>> Step 3: ran tests with coverage on and save the coverage ".ec" files in 
>> artifacts
>> Step 4: download both (.ec and .class files)
>> Step 5: given them to  jacoco task to publish the coverage  (It should 
>> interanlly merege them)
>>
>> While many of them merges smoothly, many still cry for "execution data 
>> does not match". (I checked, these are both java and kotlin classes) 
>>
>> reports {
>> csv.enabled true
>> csv.destination file("${rootProject.buildDir}/jacoco/coverage-report.csv"
>> )
>> xml.enabled true
>> xml.destination file("${rootProject.buildDir}/jacoco/coverage-report.xml"
>> )
>> html.enabled true
>> html.destination file("${rootProject.buildDir}/jacoco/html-report")
>> }
>>
>>
>> def javaClasses = []
>> def kotlinClasses = []
>> def javaSrc = []
>> def kotlinSrc = []
>> def javaPath = "intermediates/javac"
>> def kotlinPath = "tmp/kotlin-classes"
>>
>> javaSrc << "$proj.projectDir/src/main/java"
>> kotlinSrc << "$proj.projectDir/src/main/kotlin"
>> javaClasses << fileTree(dir: "<my_path>/build/${javaPath}/devDebug", 
>> excludes: fileFilter)
>> kotlinClasses << fileTree(dir: "<my_path>/build/${kotlinPath}/devDebug", 
>> excludes: fileFilter)
>>
>> sourceDirectories.from = files([javaSrc, kotlinSrc])
>> classDirectories.from = files([javaClasses, kotlinClasses])
>>
>> getExecutionData().setFrom(
>> fileTree(dir: "code_coverage", includes: ['**/*.ec']))
>>
>>
>>
>>
>>
>> *Environment InfoOS: * Linux 5.15.0-1050-azure amd64 *Java: *openjdk 
>> 17.0.9 2023-10-17 JVM: 1.8.0_382
>> Gradle 7.5 Kotlin: 1.6.21 Groovy: 3.0.10 Ant: Apache Ant(TM) version 
>> 1.10.11 compiled on July 10 2021
>>
>>
>>
>> What step maybe changing the .class files to make it feel different and 
>> marking as "does not match"?
>> Debug build setting has 
>>   - Minify false
>>   - Shrink false 
>>
>>
>>
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/e9ea5327-90d7-4bc3-86b8-907ae6660a09n%40googlegroups.com.

Reply via email to