Recently I had to spend a large amount of time on DevOps and I got stuck in integrating azure build pipeline, NUnit tests, and sonar cloud together. After some digging, I came up with a complete solution to run NUnit tests on the azure build pipeline, generate test results, and publish them to the sonar cloud dashboard. So I decided to share it with you as well. At the end of this, you will be able to run your ASP.NET NUnit tests in Azure DevOps build pipeline and publish The results to Sonar Cloud to check the test coverage and code coverage.

What are NUnit Tests?

NUnit is a unit-testing framework for .NET applications in which the entire application is isolated into diverse modules and each module is tested independently to ensure that the objective is met.

What is Sonar Cloud?

SonarQube. SonarQube (formerly Sonar) is an open-source platform developed by SonarSource for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities on 20+ programming languages.

Overall, your pipeline should consist of tasks to run Unit tests, generate and publish code coverage reports, and to run Sonarcloud analysis.

Image for post

#azure #sonarcloud #code-quality #unit-testing #data-analysis

Publish your N-UnitTest Results directly to Sonar Cloud Analysis
3.80 GEEK