1

Trying to reproduce the steps that a TFS agent perform with the SonarQube Scanner for MSBuild. I am not able to locate where the Agent injects the name of the coverage results file. The documentation states that a coverage file should be parsed to an xml file, but digging into the powershell at the SonarQubePostTest task there is no call to codecoverage.exe, neither a setting to the sonar.cs.vscoveragexml.reportsPaths variable.

How TFS 2015 agent assign coverage results to SonarQube Scanner for MSBuild in order to manually reproduce the call of the agent?

P.S. I am using vNext build definition, it is the compilation of some c# dll projects, after the build, then a set of test run using VS test.

XtianGIS
  • 967
  • 16
  • 39
  • Which one are you using XAML build or Vnext build? Could you share your related build definition settings ? Are you using publish test results task? – PatrickLu-MSFT Oct 12 '16 at 10:03

1 Answers1

-1

There should be a SonarQube begin analysis task before msbuild and a SonarQube end analysis task after msbuild.

The completed Begin Analysis definition. This just some configuration to connect to sonarqube server

enter image description here

The completed Begin Analysis definition enter image description here

The End Analysis task should be used to create a step that is executed after the “Visual Studio Test” task step if you want SonarQube to show code coverage data. In any case, it should be run after the “Visual Studio Build” step. The End Analysis task finalizes the analysis (computation of the clones, metrics, and analysis for languages other than .Net), and sends the analysis results to the SonarQube server.

More details please see this MSDN blog: Build Tasks for SonarQube Analysis

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • thank you for trying to answer my question, but your comment as well as your images did not solve the question, neither your link to the documentation. **I am not asking how to setup the SonarQube analysis task** – XtianGIS Oct 19 '16 at 12:31