<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:27:25 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[ODLPARENT-27] PowerMock tests aren&apos;t accounted for in JaCoCo coverage</title>
                <link>https://jira.opendaylight.org/browse/ODLPARENT-27</link>
                <project id="10149" key="ODLPARENT">odlparent</project>
                    <description>&lt;p&gt;Despite the version hold on JaCoCo, PowerMock tests don&apos;t appear in the coverage results; for example &lt;a href=&quot;https://sonar.opendaylight.org/drilldown/measures/12541?metric=coverage&amp;amp;rids[]=15639&amp;amp;rids[]=45971&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://sonar.opendaylight.org/drilldown/measures/12541?metric=coverage&amp;amp;rids[]=15639&amp;amp;rids[]=45971&lt;/a&gt; currently shows 0.1% coverage in NeutronL3Adapter, yet the test code covers over 60% of that class (as measured independently using IntelliJ and JaCoCo).&lt;/p&gt;

&lt;p&gt;The latest version of PowerMock (1.6.4) is supposed to fix this, but apparently doesn&apos;t. &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/32427/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/32427/&lt;/a&gt; shows how to instrument the code so it gets measured correctly. That unfortunately causes a number of &quot;class already instrumented&quot; errors to be logged, so it feels sub-optimal.&lt;/p&gt;

&lt;p&gt;I&apos;m investigating whether the latest version of JaCoCo (which would involve a Sonar plugin upgrade) fixes things.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="22150">ODLPARENT-27</key>
            <summary>PowerMock tests aren&apos;t accounted for in JaCoCo coverage</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10001">Won&apos;t Do</resolution>
                                        <assignee username="rovarga">Robert Varga</assignee>
                                    <reporter username="skitt">Stephen Kitt</reporter>
                        <labels>
                    </labels>
                <created>Tue, 12 Jan 2016 16:19:39 +0000</created>
                <updated>Sun, 17 Oct 2021 21:20:58 +0000</updated>
                            <resolved>Sun, 17 Oct 2021 21:05:07 +0000</resolved>
                                                                    <component>General</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="41781" author="kblagov@cisco.com" created="Thu, 22 Sep 2016 12:04:08 +0000"  >&lt;p&gt;Still confirmed:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://sonar.opendaylight.org/component/index?id=org.opendaylight.groupbasedpolicy%3Aios-xe-renderer%3Asrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fgroupbasedpolicy%2Frenderer%2Fios_xe_provider%2Fimpl%2Fwriter%2FPolicyWriterUtil.java&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://sonar.opendaylight.org/component/index?id=org.opendaylight.groupbasedpolicy%3Aios-xe-renderer%3Asrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fgroupbasedpolicy%2Frenderer%2Fios_xe_provider%2Fimpl%2Fwriter%2FPolicyWriterUtil.java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;shows line coverage of 19.9%, while in IntelliJ IDEA it is 93%. Total Groupbasedpolicycoverage is 70.2% (Sonar) vs 78% (IntelliJ)&lt;/p&gt;

&lt;p&gt;On Groupbasedpolicy, we are striving (and being required too) to make 80% covered, so it is very unfortunate to have PowerMock tests skipped by Sonar. As PowerMock team states that the JaCoCo incompatibiliy was fixed in 1.6.4 (Dec 2015), we hope it is just a matter of ODL&apos;s Sonar setup.&lt;/p&gt;</comment>
                            <comment id="41782" author="skitt@redhat.com" created="Thu, 22 Sep 2016 12:10:34 +0000"  >&lt;p&gt;The incompatibility is supposed to be fixed, but in my tests that&apos;s not the case (I haven&apos;t looked into it enough to re-open the bug upstream).&lt;/p&gt;

&lt;p&gt;Long term I&apos;d like us to move away from using PowerMock altogether, it tends to encourage sub-optimal design and test choices...&lt;/p&gt;</comment>
                            <comment id="67172" author="rovarga" created="Thu, 22 Aug 2019 08:23:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=skitt&quot; class=&quot;user-hover&quot; rel=&quot;skitt&quot;&gt;skitt&lt;/a&gt; does this still reproduce with pm-2.0.2?&lt;/p&gt;</comment>
                            <comment id="67183" author="skitt@redhat.com" created="Thu, 22 Aug 2019 09:17:46 +0000"  >&lt;p&gt;Apparently yes, Sonar reports 0% coverage for SouthboundUtil.getManagingNode in ovsdb even though it&#8217;s tested by SouthboundUtilTest (which uses PowerMock).&lt;/p&gt;</comment>
                            <comment id="69722" author="rovarga" created="Sun, 17 Oct 2021 21:04:52 +0000"  >&lt;p&gt;So we are getting an execution profile for southbound-impl, but we also get the following:&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;[INFO] --- jacoco-maven-plugin:0.8.7:report (report) @ southbound-impl ---
[INFO] Loading execution data file /home/nite/odl/ovsdb/southbound/southbound-impl/target/code-coverage/jacoco.exec
[INFO] Analyzed bundle &apos;ODL :: ovsdb :: southbound-impl&apos; with 79 classes
[WARNING] Classes in bundle &apos;ODL :: ovsdb :: southbound-impl&apos; do not match with execution data. For report generation the same class files must be used as at runtime.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointUpdateCommand does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointCreateCommand does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/OvsdbConnectionManager$ConnectionReconciliationTriggers does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/ovsdb/transact/TerminationPointDeleteCommand does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/ovsdb/transact/TransactUtils does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/ovsdb/transact/OvsdbNodeUpdateCommand does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/OvsdbConnectionManager$1 does not match.
[WARNING] Execution data for class org/opendaylight/ovsdb/southbound/OvsdbConnectionManager$2 does not match.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Which is indicative of these classes being manipulated by powermock&apos;s JUnitRunner. I do not see how we can work this around &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;There is quite a bit of background: here is one &lt;a href=&quot;https://github.com/powermock/powermock/issues/422&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;powermock issue&lt;/a&gt; and corresponding &lt;a href=&quot;https://github.com/powermock/powermock/wiki/Code-coverage-with-JaCoCo&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;writeup&lt;/a&gt;. PowerMocks migration to ByteBuddy is &lt;a href=&quot;https://github.com/powermock/powermock/issues/727&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;dead in the water&lt;/a&gt;. The other side of the coin is JaCoCo, which has &lt;a href=&quot;https://github.com/jacoco/jacoco/issues/51&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;a long-standing issue&lt;/a&gt; around this.&lt;/p&gt;

&lt;p&gt;All in all, I do not believe we can fix this globally &amp;#8211; the offline instrumentation workaround might work, but is inappropriate for pretty much the entire world. Since this is quite limited in terms of affected projects (see &lt;a href=&quot;https://jira.opendaylight.org/browse/ODLPARENT-275&quot; title=&quot;Remove powermock declaration&quot; class=&quot;issue-link&quot; data-issue-key=&quot;ODLPARENT-275&quot;&gt;&lt;del&gt;ODLPARENT-275&lt;/del&gt;&lt;/a&gt;), I think the proper fix is to deploy one of the solutions outlined in project-local manner.&lt;/p&gt;</comment>
                            <comment id="69723" author="rovarga" created="Sun, 17 Oct 2021 21:08:05 +0000"  >&lt;p&gt;Downstreams affected by this issue are advised to deploy one of the referenced workarounds, or, preferably, migrate to Mockito, which can now &lt;a href=&quot;https://www.baeldung.com/mockito-mock-static-methods&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;mock static methods&lt;/a&gt; as well as &lt;a href=&quot;https://www.baeldung.com/mockito-final&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;spy final classes&lt;/a&gt;.&lt;/p&gt;</comment>
                            <comment id="69724" author="rovarga" created="Sun, 17 Oct 2021 21:20:58 +0000"  >&lt;p&gt;So specifically here, the reason for coverage not being shown is that SouthboundUtil is subject to @PrepareForTest, which loads the class from disk and hence blows away JaCoCo instrumentation. That is the only way Javassist can work with classes and the reason we have migrated away from it in mdsal-binding-dom-codec &amp;#8211; ByteBuddy is &lt;b&gt;way&lt;/b&gt; better for this sort of task.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="34669">ODLPARENT-275</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4941</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=4941]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i022uv:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>