How to do Code coverage and integrated the same to the Git pipe line

I have integrated the sonar scanner for the asp.net web applications for the code analysis purpose.

  1. How to do code coverage for .net applications?

  2. How to integrated the code coverage to the Git pipeline.?

Request to share input for the same.

Hi Venkat,

  1. For code coverage, see my post here: Need help for Unit Test Code coverage for SonarCloud

  2. For integrating your code coverage into a pipeline, you need to use a Continuous Integration (CI) service. Git itself is not a CI service. You can use Github or Azure DevOps or Travis CI for pipeline work. Here are some examples and tutorials:

Etc. I gave many examples that I just googled so take with a grain of salt.

Joe

Thanks for the above link.

  1. Can you please let me know how to do the code coverage for angular project?

I have tried to integrate the code coverage for the Angular project which I have followed the below article.

But in the end when i run the npm run sonar

I am getting the below error. Can you please guide me on this.

Try looking at the Angular project that our Consultants handle here: https://github.com/SonarSource/sonar-training-examples (in the folder “angular”)

Run that example project and observe the sonar-project.properties and compare to your own project.

Here is a similar post that might help you if you encounter a similar issue: SonarQube TypeScript test integration