Hi Ashish,

JaCoCo as well as Cobertura is based on bytecode instrumentation. Having both 
instrumenting tools in the same build means that one tool instruments classes 
which have already been instrumented by the other tool. I do definitely not 
recommend this setup. Please run one tool or the other during a single build.

Regards,
-marc

> On 3. Jun 2024, at 19:01, Ashish Ranjan Sinha <ashishranjan2...@gmail.com> 
> wrote:
> 
> Hi Marc,
> 
> Thank you for your reply 
> 
> What I observe during weekend is if my build is having cobertura and jacoco 
> code coverage, some of the classes are listed as picked by jacoco but the 
> coverage is 0%. Where as if the build only have cobertura the same class 
> which was picked by jacoco is not picked any more and the coverage is 0%. I 
> am guessing something is wrong with cobertura or sap ssws. 
> 
> 
> Regards,
> Ashish 
> 
> On Mon, 3 Jun 2024 at 9:09 PM, Marc Hoffmann <hoffm...@mountainminds.com 
> <mailto:hoffm...@mountainminds.com>> wrote:
>> Hi Ashish,
>> 
>> this looks good so far. At least a few lines are marked as covered. So 
>> execution data seems to be collected correctly.
>> 
>> What I would do next is to add some proof that the code in question ist 
>> actually executed during the JaCoCo test run. For example add logging of 
>> throw an exception.
>> 
>> Regards,
>> -marc
>> 
>>> On 1. Jun 2024, at 09:27, Ashish Ranjan Sinha <ashishranjan2...@gmail.com 
>>> <mailto:ashishranjan2...@gmail.com>> wrote:
>>> 
>>> Hi Marc,
>>> 
>>> I see the class is already part of the session page. However I am still 
>>> getting the 0% code coverage for it.
>>> 
>>> <2024-06-01_12-46-59.png>
>> 
>>> 
>>> 
>>> <2024-06-01_12-46-35.png>
>>> 
>>> The same test and class files are used for Cobertura and I could see the 
>>> coverage is high for these classes. FYI - I am using openJDK17 with RHEL 
>>> 8.9. I am using runtime instrumentation for the classes. 
>>> 
>>> 
>>> Regards,
>>> Ashish
>>> 
>>> On Wednesday, May 29, 2024 at 11:27:15 PM UTC+5:30 Marc R. Hoffmann wrote:
>>> Hi Ashish,
>>> 
>>> our FAQ <https://www.jacoco.org/jacoco/trunk/doc/faq.html> contains some 
>>> information about this. Did you already check?
>>> 
>>> Regards,
>>> -marc
>>> 
>>> Why does a class show as not covered although it has been executed?
>>> First make sure execution data has been collected. For this select the 
>>> Sessions link on the top right corner of the HTML report and check whether 
>>> the class in question is listed. If it is listed but not linked the class 
>>> at execution time is a different class file. Make sure you're using the 
>>> exact same class file at runtime as for report generation. Note that some 
>>> tools (e.g. EJB containers, mocking frameworks) might modify your class 
>>> files at runtime. Please see the chapter about class ids 
>>> <https://www.jacoco.org/jacoco/trunk/doc/classids.html> for a detailed 
>>> discussion.
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> On 28. May 2024, at 11:31, Ashish Ranjan Sinha <ashishra...@gmail.com <>> 
>>>> wrote:
>>>> 
>>> 
>>>> Hi,
>>>> 
>>>> I am using Jacoco 0.8.11 for OpenJDK17. We are using Runtime 
>>>> instrumentation for instrumenting the .class files under the multiple 
>>>> packages. I am attaching the java agent to the JVM and restarting my 
>>>> system. Then running my Junits which is integrated test running separately 
>>>> on Jenkins pipeline. Once the Junits are run, jacoco.exec is flushed with 
>>>> executable data collected during junits. I am generating the report using 
>>>> the Jacoco cli command and storing the report under coverage/index.html.
>>>> 
>>>> However, I observe some of the classes having 0% despite the associated 
>>>> Junit test running against it. When compared with Cobertura coverage 
>>>> report, the jacoco report shows very less coverage for the same set of 
>>>> classes and Junits. 
>>>> 
>>>> 
>>>> Need some guidance as what I am doing wrong here.
>>>> 
>>>> 
>>>> Regards,
>>>> Ashish.
>>>> 
>>>> 
>>> 
>>>> -- 
>>>> 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 jacoco+un...@googlegroups.com <>.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jacoco/c7eb0406-d655-477d-a1c0-41c5ddf8117en%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jacoco/c7eb0406-d655-477d-a1c0-41c5ddf8117en%40googlegroups.com?utm_medium=email&utm_source=footer>.
>>> 
>>> 
>>> -- 
>>> 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 jacoco+unsubscr...@googlegroups.com 
>>> <mailto:jacoco+unsubscr...@googlegroups.com>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jacoco/e3bcd9be-41a4-41e1-84f3-6bbc8b12c0c7n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/jacoco/e3bcd9be-41a4-41e1-84f3-6bbc8b12c0c7n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>> 
>>> <2024-06-01_12-46-35.png><2024-06-01_12-46-59.png>
>> 
>> 
>> -- 
>> 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 jacoco+unsubscr...@googlegroups.com 
>> <mailto:jacoco+unsubscr...@googlegroups.com>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jacoco/2E12B2D2-0203-40F3-8501-CD18793B58C2%40mountainminds.com
>>  
>> <https://groups.google.com/d/msgid/jacoco/2E12B2D2-0203-40F3-8501-CD18793B58C2%40mountainminds.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> 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 jacoco+unsubscr...@googlegroups.com 
> <mailto:jacoco+unsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jacoco/CAMMTdifpQ_Jdx%2BE4NNEgJQHsGg_y4qfZDXCWo-kpgtpQChthsw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/jacoco/CAMMTdifpQ_Jdx%2BE4NNEgJQHsGg_y4qfZDXCWo-kpgtpQChthsw%40mail.gmail.com?utm_medium=email&utm_source=footer>.

-- 
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 jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/B5040D10-E119-42A3-87DF-E66339855BFD%40mountainminds.com.

Reply via email to