Publish coverage reports post msbuild in Jenkins job

Hi @koboldul ,

Welcome to SonarSource Community! :sonarsource:

From our Test Coverage & Execution documentation, note the section about “Improting .NET reports”:

Importing .NET reports

To import .NET reports, the report generation process must be executed after the begin step and before the end MSBuild command. The following steps detail importing .NET reports:

  1. Run the SonarScanner.MSBuild.exe begin command, specifying the absolute path where the reports will be available using the /d:propertyKey="path" syntax (“propertyKey” depends on the tool)
  2. Build your project using MSBuild
  3. Run your test tool, instructing it to produce a report at the same location specified earlier to the MSBuild SonarQube Runner (How to generate reports with different tools)
  4. Run the SonarScanner.MSBuild.exe end command

For more information, see the Generate Reports for C#, VB.net Community Post.

Thus, you must run the tests after the BEGIN step and before the END step. If you can run the .NET build and the .NET test report generation in parallel, then that might work, but you still need to make sure the report is complete before you run the END step because the END step requires the entire test report during the scanner analysis.