How can we got coverage of Unit Test by using Azure DevOps pipeline (build) integration with SonarQube (hosted on Azure VM).?

csharp
sonarqube
(19844 Lichen) #1

Hi experts,
How can we got coverage of Unit Test by using Azure DevOps pipeline (build) integration with SonarQube (hosted on Azure VM)?
In other words, how can we get this coverage of unit test and push to SonarQube?

I have referred to the link:
Analyzing with SonarQube Extension for VSTS-TFS
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Extension+for+VSTS-TFS

Our scenario is:
We setup an Ubuntu VM on Azure deployed SonarQube server, after that we got build pipeline like the attachments.

We use plug-in tools:
“Prepare Analysis Configuration”
“Run Code Analysis”
“Publish Quality Gate Result”

Our project is C# .NET CORE

I have already configured like the above link&guide but it’s not success so could you kindly please advise me how to configurate it correctly?

attachments have been uploaded.

(19844 Lichen) #2

The issue still remains.
Is there anything need to provide further?
Or is there something I haven’t configured yet?

Regards

(Andrei Epure) #3

hi @19844_lichen . During your build step, are you generating the coverage data?
Have you done this step mentioned in the docs

  • Click the Visual Studio Test task and check the Code Coverage Enabled checkbox to process the code coverage and have it imported into SonarQube. ( Optional but recommended )