Hi Monisha G, What was then used for includes option ?
Regards, Ashish On Thursday, April 20, 2023 at 3:38:18 PM UTC+5:30 Monisha G wrote: > Hi Evgeny, > > Thanks a lot for your suggestion ! After removing "includes=*.class" , we > are able to generate the report . > > Thanks, > Monisha > > On Thursday, 20 April 2023 at 14:36:44 UTC+5:30 Evgeny Mandrikov wrote: > >> Hi, >> >> On Wednesday, April 19, 2023 at 12:13:01 PM UTC+2 [email protected] >> wrote: >> >> Basically , when jacoco report is generated on a server with RHEL 7.7 >> (Maipo) , the jacoco report shows accurate coverage . When this same code >> is compiled and executed on a server with RHEL 8.7 , the code coverage >> report shows 0% . >> >> The report also shows "No execution data available" instead of displaying >> the class ID's. >> >> 1. We've verified that the same java (*java8*) and jacoco( >> *org.jacoco.agent-0.8.2.jar* & *org.jacoco.cli-0.8.4-nodeps.jar*) >> version is being used on both the servers. Basically , the same version and >> file system exists on both servers. >> >> 2. Setting arguments for Jacoco : >> >> JAVA_OPTS="-javaagent:/prd/im/bin/IMGUI/CodeCoverage/org.jacoco.agent-0.8.2.jar=destfile=/prd/im/bin/IMGUI/CodeCoverage/IMGUI_Code_Coverage/gui.exec,append=true,includes=*.class >> >> -Djacoco.dump.on.exit=true -Djacoco.debug=true >> -Djacoco.classDumpDir=/prd/im/bin/IMGUI/CodeCoverage/Testdump/ >> >> >> The parameter "includes" of JaCoCo agent is not about names of files, but >> about names of classes, i.e. >> for the following Example.java >> >> class Example { >> public static void main(String[] args) { >> System.out.println("Hello"); >> } >> } >> >> execution of >> >> javac Example.java >> java "-javaagent:jacocoagent.jar=includes=*.class" -cp . Example >> >> will produce jacoco.exec of small size without information about any >> classes and >> >> java -jar jacococli.jar execinfo jacoco.exec >> >> will show this >> >> [INFO] Loading exec file jacoco.exec. >> CLASS ID HITS/PROBES CLASS NAME >> Session "Godins-M1-MacBook-Pro-a4a92418": Thu Apr 20 09:55:19 CEST 2023 - >> Thu Apr 20 09:55:19 CEST 2023 >> >> and in this case generated report shows "No execution data available". >> >> Quoting documentation of agent >> https://www.jacoco.org/jacoco/trunk/doc/agent.html about "includes" >> parameter >> >> > Except for performance optimization or technical corner cases this >> option is normally not required. >> >> The default is to include all classes, so execution of >> >> java "-javaagent:jacocoagent.jar" -cp . Example >> java -jar jacococli.jar execinfo jacoco.exec >> >> produces >> >> [INFO] Loading exec file jacoco.exec. >> CLASS ID HITS/PROBES CLASS NAME >> Session "Godins-M1-MacBook-Pro-1cf6c872": Thu Apr 20 10:59:40 CEST 2023 - >> Thu Apr 20 10:59:40 CEST 2023 >> d37513b16b860f3e 1 of 2 Example >> >> From the above, quite doubtful that you have exact same settings or that >> you're receiving the expected results on RHEL 7. >> >> Also could be noted that I have no idea why you have >> >> -Djacoco.dump.on.exit=true -Djacoco.debug=true >> -Djacoco.classDumpDir=/prd/im/bin/IMGUI/CodeCoverage/Testdump/ >> >> JaCoCo agent doesn't use them and has never used them. >> >> >> Regards, >> Evgeny >> > -- 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/65db0854-a3c1-499e-a41f-d0a78d660e40n%40googlegroups.com.
