Unable to import nunit test results to sonarqube

Hi,

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    NETFramework,Version=v4.6.2, SonarScanner for MSBuild 5.0.4
  • what are you trying to achieve
    I am trying to import nunit test results to sonarqube for the code coverage.
    below error.
SonarScanner for MSBuild 5.0.4
Using the .NET Framework version of the Scanner for MSBuild
Post-processing started.
20:08:03.539  The SonarScanner for MSBuild integration failed: SonarQube was unable to collect the required information about your projects.
Possible causes:
  1. The project has not been built - the project must be built in between the begin and end steps
  2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 14.0.25420.1 and higher are supported.
  3. The begin, build and end steps have not all been launched from the same folder
  4. None of the analyzed projects have a valid ProjectGuid and you have not used a solution (.sln)
  • what have you tried so far to achieve this

The command i tried is this,
SonarScanner.MSBuild.exe begin /k:“test-project” /d:sonar.cs.nunit.reportsPaths="ApplicationTestResult.xml"
nunit3-console testresult.dll --result="ApplicationTestResult.xml"
SonarScanner.MSBuild.exe end

I am running the test cases and importing the results to sonarqube after building the solution. Please check this and let me know what is missing.

Thanks.

Hi @kumarnis , welcome to the community and thanks for using the product.

Could I ask you provide me with some logs? I can create a private thread for you if that’s needed.

  1. Logs of the end step

  2. MsBuild log of the build between scanner begin and end steps