Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sonar not picking up the visual studio test report paths

We are running SonarQube(5.0.1), with sonar.net-runner on a TFS (2010) team build.

FxCop works fine, and everything runs perfect, I see all the issues in sonar.

However, when I try to pull in the test results in sonar, I run into an issue.

When I set the property sonar.cs.vstest.reportsPaths to an absolute file of a trx file, it publishes my test results to sonar. Great.

But when I use a wild card, my test results don't get published in sonar. Not so great

Configurations I've tried.


#1
sonar.cs.vstest.reportsPaths=E:/Builds/1/74/TestResults/*.trx

#2
sonar.cs.vstest.reportsPaths=TestResults/*.trx

#3
sonar.cs.vstest.reportsPaths=**/*.trx

#4
sonar.cs.vstest.reportsPaths=.**/*.trx

Full configuration




# ----- Project identification
sonar.projectVersion=2.6.0.0914
sonar.projectName=MySolution
sonar.projectKey=Company:MySolution

# ----- Use UTF-8 encoding, otherwise analysis is unable to read files
sonar.sourceEncoding=UTF-8

# ----- Visual studio bootstrapper
# Enable the Visual Studio bootstrapper
sonar.visualstudio.enable=true

#Define the solution to run sonar against
sonar.visualstudio.solution=MySolution.sln

#Specify the pattern of the test projects
sonar.visualstudio.testProjectPattern=.*Test*.

#We are using custom output paths.
sonar.visualstudio.outputPaths=E:/Builds/1/74/Binaries

# ----- FxCop
sonar.cs.fxcop.aspnet=false
sonar.cs.fxcop.fxCopCmdPath=D:/Sonar.NET/FxCop/FxCopCmd.exe


# ----- Unit Test Results
sonar.cs.vstest.reportsPaths=.**/*.trx.


# This property is set because it is required by the SonarQube Runner.
# But it is not taken into account because the location of the source
# code is retrieved from the .sln and .csproj files.
sonar.sources=.

like image 289
Preben Huybrechts Avatar asked Sep 28 '22 12:09

Preben Huybrechts


1 Answers

You need to provide full path to .trx file.

sonar.cs.vstest.reportsPaths=../TestResults/TestResult.trx

like image 93
miillaap Avatar answered Nov 30 '22 09:11

miillaap