question

ChetanNavale-0553 avatar image
0 Votes"
ChetanNavale-0553 asked TianyuSun-MSFT commented

Code coverage calculation issue with Visual Studio & Azure Pipeline

Hello,
We are developing .NET Core 3.1 application using Visual Studio 2019. Code development is complete and also we have written unit test cases in XUnit for the code.
For code coverage calculations, we have used SonarLint extension in Visual Studio. When we are running Test explorer there is no issue with test cases and also it is showing code coverage as 77% in Code coverage results screen.
I am not sure whether it is code coverage calculated by Visual Studio inbuilt tool or Sonarlint.
Also when we push this code to azure repository and try building the pipeline with azure CICD including MSbuild, sonarqube tasks, code coverage is not getting calculated.
Herewith I have attached code coveragexml file screen shot that is getting generated by Visual studio which shows everything null also attaching the same file display in visual studio coverage result panel.
We don't understand whether this is correctly generating or its corrupt one.
Need urgent help on this topic.

88480-capture.jpg


dotnet-csharpvs-testing
capture.jpg (230.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered TianyuSun-MSFT commented

Hello @ChetanNavale-0553 ,

Welcome to Microsoft Q&A forum.

It seems this issue appeared after you built the project by using Azure Pipeline, since Azure Pipeline is currently not supported in the Microsoft Q&A forum, I suggest you post this issue in Stack Overflow tagged with Azure Pipelines or Azure DevOps, or post in Developer Community to get better help.

Thanks for your understanding.

Best Regards,
Tianyu


If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello TianySun,
We are facing issue both in visual studio and in azure pipeline
I think I posted this query under VS segment. Request you to kindly help with VS issue. Azure pipeline issue will automatically gets resolved once its fixed in VS 2019.

0 Votes 0 ·

Hello @ChetanNavale-0553 , thanks for your feedback. From VS aspect, per the screenshot, I think this is not normal. May I ask, is this .coverage xml file opened and displayed in Visual Studio Code Coverage Results window?

0 Votes 0 ·

Yes, When I open this file in Visual Studio in Coverage result section it displays me %.

0 Votes 0 ·
Show more comments