How to calculate code coverage in .NET and integrate into Azure DevOps

preview_player
Показать описание

Hi! I’m Artem Grabovski and today we will discuss how you could efficiently use code coverage tools in .NET and integrate them into Azure DevOps.

In this video we will discuss the following questions:

- Which open source library you could use to calculate code coverage in .NET?
- How to visualize code coverage reports?
- How to integrate code coverage into YAML build pipelines in Azure DevOps?
- How to control advanced settings for code coverage tools?

0:00 Introduction to code coverage.
1:26 Demo. Integrate code coverage into project.
4:50 Demo. Visualize Coverlet report using Report Generator.
7:27 Demo. Integrate code coverage into YAML build pipelines in Azure DevOps.

My setup for YouTube videos:

Follow me:

#dotnet #csharp #codecoverage #coverlet #unittesting #azuredevops
Рекомендации по теме
Комментарии
Автор

thanks. Can you force failure in the pipeline if the the threashold is not achieved?

pigrebanto
Автор

Very interesting, explains it very well!

АлексейУкраинец-зй
Автор

Nicely done Artem! There is something you probably could consider for the next video: on real projects, there are many assemblies with the Unit Tests. The approach you demonstrated will just grab the firstly found cobertura report found while you'll have many of them, for each assembly. So, if you want it to work properly, I believe, you need to combine the reports prior to publishing the report results.

praleska-eu
Автор

Very nicely explained.

One question (may be a silly one).
It can be configured on any kind of unit tests, right (you used XUnit)? I mean it can be configured on NUnit and MSTests too?
It is not dependent on the unit testing framework, right?

BadmintonBoss
Автор

Very nice explanation
But I have one question, How can I create a dashboard for all pipelines? For example, if I have two repo and both have their own code coverage, but I want to create one dashboard that shows all the metrics that I have in both pipelines

anment
Автор

Thanks for this useful comment. I will try to apply it in my project

ukrnets
Автор


I got to know today by this videos.. test and code coverage are difference and relation. Thank 😮😊

sivaramkumar_perumal