Re: $jacocoData column is added in excel sheet

141 views
Skip to first unread message

Evgeny Mandrikov

unread,
Sep 8, 2017, 9:21:40 AM9/8/17
to punam....@amobee.com, jac...@googlegroups.com
Hi,

First of all you're trying to use wrong mailing list - JaCoCo Users Mailing List is located at http://groups.google.com/forum/#!forum/jacoco Please use it in future and I'm directing response to this list.

Then answering your question - similar questions were asked and answered many times, here is quote from JaCoCo FAQ ( http://www.jacoco.org/jacoco/trunk/doc/faq.html ):

My code uses reflection. Why does it fail when I execute it with JaCoCo?
To collect execution data JaCoCo instruments the classes under test which adds two members to the classes: A private static field $jacocoData and a private static method $jacocoInit(). Both members are marked as synthetic.
Please change your code to ignore synthetic members. This is a good practice anyways as also the Java compiler creates synthetic members in certain situation.

So change your code or library that uses reflection to ignore synthetic members ( https://docs.oracle.com/javase/7/docs/api/java/lang/reflect/Member.html#isSynthetic() ) or instruct JaCoCo to exclude class from instrumentation and hence from coverage analysis.

And please consider spending a bit more time in future on search and reading of documentation before raising a question.

Regards,
Evgeny

On Fri, Sep 8, 2017 at 2:10 PM <punam....@amobee.com> wrote:
Hi All,

I am using jenkins 2.7.2. and jacoco plugin - 0.7.9. In one of my jenkins build i have configured jacoco and it is working succefully.

The issue that i encountered is there are some automation test cases which get executed. Some test cases generate excel sheet as per requirement. Now, when jacoco is enabled it for the build, the automation test case which generates excel sheet. It adds one more column to excel sheet as '$jacocoData' and my test fails as the column numbers did not match the given column number.

Here i dont understand how jacoco can access my automation test excel sheet file. and add column to it. It happens for one test case only.

Does jacoco reads internal files while generating reports.

Can somebody please put some light on it.

Thanks.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages