How a Little Environment Variable Can Break Your Integration Tests in ReSharper & Rider

Last week we run into a strange problem with our integration tests. On some developer machines everything worked fine, while other machines got errors like this one: System.InvalidOperationException : Cannot resolve scoped service ‘my.application.IOrderRepository’ from root provider. at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteValidator.ValidateResolution(Type serviceType, IServiceScope scope, IServiceScope rootScope)   The problem It took us hours to understand what was …

Read more

How to Get the Code Coverage Data Into SonarQube

The code coverage is an important part of the quality metrics of SonarQube. Unfortunately, SonarQube needs some extra steps to use our code coverage reports from our Azure DevOps pipeline as part of its code analysis. As in the last posts on code coverage, we again use Coverlet and ReportGenerator as part of our Azure …

Read more

Publishing Code Coverage in Your Azure DevOps Build Pipeline

Last week we used Coverlet and ReportGenerator to collect code coverage on our development machines. In this post we continue this journey and extend our build pipelines to get a nice coverage report with every continuous integration build.   Extending the test task We can collect the code coverage files in the build pipeline by …

Read more

Code Coverage made Easy: A Step-by-Step Guide for .NET 6

For .Net 4.8 it was enough to install Visual Studio Enterprise Edition on the build server and check the box for code coverage in the Testing task of Azure DevOps. The build agent then collected the coverage data and published it as part of your builds. Unfortunately, for .Net 6 this no longer works, and …

Read more