Folders missing in SonarCloud coverage

msbuild
coverage
dotnet
(Kanika Kumar) #1

Hi,

We have configured Microsoft VSTS project with SonarCloud, we have multiple folders in Gitrepo but after analysis is successful, some of the folders are missing in SonarCloud coverage.


Could you please suggest what could be the possible reason for this?

Thank you!

1 Like
(Fabrice Bellingard) #2

Hi Kanika,

on the screenshot that you provide, I see that you are drilling down into the “coverage on new code” metric. This means that you are looking at code which was recently modified only (last 30 days by default on SonarCloud). This might be why you see only a portion of your code base.

If you drill down on the overall coverage, you should see everything.

(Kanika Kumar) #3

Thank you for the response.

Just a question, for example, if I have total 10 test cases and out of them 8 passed and 2 failed, and this is integrated in vsTest Assemblies task in VSTS, so will I get the coverage of passed tests in SonarQube or SonarCloud?

(Fabrice Bellingard) #4

If your build definition is configured to not fail the build when there are failed tests, yes, you should end up having the coverage produced by the 8 successful test cases.

(Kanika Kumar) #5

We have enabled in such a way, that build task should not fail with failed tests, but we are not getting the Code Coverage. Attaching the screen-shots, please check.

Thanks much for the help!



(Fabrice Bellingard) #6

Just to clarify, are you on SonarQube or SonarCloud? The screenshots you provided tend to indicate that you are on SonarQube. In which case it’s important that you specify which version of SonarQube and the SonarQube extension for TFS you are using.

(Shravanipandarmish Gep) #7

Hi Fabrice, So we are currently using sonarcloud and doing a poc on soanrqube enterprise 7 version as we are facing some random analysis issues on Cloud.
for the same project (catalog) mentioned above we are facing an issue intermittently both on Cloud and Qube.


Analysis throws an error saying “Failed to find input file”. Although the same files are present in the source code on GitHub. can you please suggest what can be done here.
Whenever this error occurs, code coverage also goes down.