<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Code coverage is not being included for code under '/web/src' in CRM and CX Q&amp;A</title>
    <link>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaa-p/12113185#M415818</link>
    <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/784036/abhinavsingh11.html"&gt;Abhinav Singh&lt;/A&gt; &lt;BR /&gt;I am using SonarQube 6.7.7.&lt;/P&gt;&lt;P&gt;In hybris I coud not find the ant task to run test cases which will covers /src as well as /web/src.&lt;/P&gt;&lt;P&gt;First of all for that we need to write our own ant target which will cover above, then in sonar.xml we need to change the 'if elseif' condition to include binaries for /src and /web/src.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;if&amp;gt;
&amp;lt;available file="${@{extname}.relative}/classes" type="dir"/&amp;gt;
&amp;lt;then&amp;gt;
&amp;lt;property name="@{extname}.sonar.java.binaries" value="classes,${requiredcp}"/&amp;gt;
&amp;lt;/then&amp;gt;
&amp;lt;elseif&amp;gt;
&amp;lt;available file="${@{extname}.relative}/web/webroot/WEB-INF/classes" type="dir"/&amp;gt;
&amp;lt;then&amp;gt;
&amp;lt;property name="@{extname}.sonar.java.binaries" value="web/webroot/WEB-INF/classes,${requiredcp}"/&amp;gt;
&amp;lt;/then&amp;gt;
&amp;lt;/elseif&amp;gt;
&amp;lt;/if&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 17 Dec 2019 07:23:09 GMT</pubDate>
    <dc:creator>sintu_pal_cts</dc:creator>
    <dc:date>2019-12-17T07:23:09Z</dc:date>
    <item>
      <title>Code coverage is not being included for code under '/web/src'</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaq-p/12113183</link>
      <description>&lt;P&gt;I am using Jacoco and SonarQube with Hybris(1905) for getting the coverage report on SonarQube. I am getting the report except the source codes under ‘/web/src‘.&lt;/P&gt;
  &lt;P&gt;I have tried to check the coverage in intellij using the same 'jacoco.exec' file its shows coverage properly in there including the '/web/src'.&lt;/P&gt;
  &lt;P&gt;I am not sure how to get the coverage for these source code please help. I am using below properties.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;sonar.java.coveragePlugin=jacoco
sonar.dynamicAnalysis=reuseReports
sonar.jacoco.reportPath=${HYBRIS_LOG_DIR}/junit/jacoco.exec
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 05:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaq-p/12113183</guid>
      <dc:creator>sintu_pal_cts</dc:creator>
      <dc:date>2019-11-27T05:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: Code coverage is not being included for code under '/web/src'</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaa-p/12113184#M415817</link>
      <description>&lt;P&gt;What version of jacocoagent jar and sonarqube are you using?&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2019 15:19:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaa-p/12113184#M415817</guid>
      <dc:creator>abhinavsingh11</dc:creator>
      <dc:date>2019-12-05T15:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Code coverage is not being included for code under '/web/src'</title>
      <link>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaa-p/12113185#M415818</link>
      <description>&lt;P&gt; @&lt;A href="https://answers.sap.com/users/784036/abhinavsingh11.html"&gt;Abhinav Singh&lt;/A&gt; &lt;BR /&gt;I am using SonarQube 6.7.7.&lt;/P&gt;&lt;P&gt;In hybris I coud not find the ant task to run test cases which will covers /src as well as /web/src.&lt;/P&gt;&lt;P&gt;First of all for that we need to write our own ant target which will cover above, then in sonar.xml we need to change the 'if elseif' condition to include binaries for /src and /web/src.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;if&amp;gt;
&amp;lt;available file="${@{extname}.relative}/classes" type="dir"/&amp;gt;
&amp;lt;then&amp;gt;
&amp;lt;property name="@{extname}.sonar.java.binaries" value="classes,${requiredcp}"/&amp;gt;
&amp;lt;/then&amp;gt;
&amp;lt;elseif&amp;gt;
&amp;lt;available file="${@{extname}.relative}/web/webroot/WEB-INF/classes" type="dir"/&amp;gt;
&amp;lt;then&amp;gt;
&amp;lt;property name="@{extname}.sonar.java.binaries" value="web/webroot/WEB-INF/classes,${requiredcp}"/&amp;gt;
&amp;lt;/then&amp;gt;
&amp;lt;/elseif&amp;gt;
&amp;lt;/if&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 07:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/crm-and-cx-q-a/code-coverage-is-not-being-included-for-code-under-web-src/qaa-p/12113185#M415818</guid>
      <dc:creator>sintu_pal_cts</dc:creator>
      <dc:date>2019-12-17T07:23:09Z</dc:date>
    </item>
  </channel>
</rss>

