xslttfssonarqubegoogletesttfs-2015

Unable to import Google Test metrics in Sonarqube


I am using TFS 2015 (update 2), C++, Google test and Sonarqube 5.6 (with Cxx community plugin). I am able to import the coverage, compute duplication, create issues using cppcheck but the number of tests is not importing in sonarqube.

I need to generate a Junit-like XML file using <test executable> --gtest_output=xml:<filename> but in TFS (vNext), I use the VSTestTask which uses vstest.console.exe to run my *Test.exe and there seems to be no way to output as xml (it defaults to .trx).

Has anyone managed to correctly import GTest test metrics into sonarqube? Is a XSLT to transform from trx to xunit the only way...?

May be i need to properly fill in the sonar.cxx.vstest.reportsPaths but the filename of the trx is dynamically set by the vstest.console.exe...

Thanks, Jon


Solution

  • I just put **/TestResults/*.trx in Visual Studio Test Reports Paths (sonar.cxx.vstest.reportsPaths) and now it is being loaded correctly... go figure.