cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Code coverage is not being included for code under '/web/src'

sintu_pal_cts
Explorer
0 Likes
1,591

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‘.

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'.

I am not sure how to get the coverage for these source code please help. I am using below properties.

sonar.java.coveragePlugin=jacoco
sonar.dynamicAnalysis=reuseReports
sonar.jacoco.reportPath=${HYBRIS_LOG_DIR}/junit/jacoco.exec

Accepted Solutions (1)

Accepted Solutions (1)

sintu_pal_cts
Explorer
0 Likes

@Abhinav Singh
I am using SonarQube 6.7.7.

In hybris I coud not find the ant task to run test cases which will covers /src as well as /web/src.

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.

<if>
<available file="${@{extname}.relative}/classes" type="dir"/>
<then>
<property name="@{extname}.sonar.java.binaries" value="classes,${requiredcp}"/>
</then>
<elseif>
<available file="${@{extname}.relative}/web/webroot/WEB-INF/classes" type="dir"/>
<then>
<property name="@{extname}.sonar.java.binaries" value="web/webroot/WEB-INF/classes,${requiredcp}"/>
</then>
</elseif>
</if>

Answers (0)