2015-03-19 53 views
3

我們正在運行SonarQube(5.0.1),在TFS(2010)團隊版本上使用sonar.net-runner。聲吶沒有拾取視覺工作室測試報告路徑

FxCop正常工作,一切運行完美,我看到了聲納中的所有問題。

但是,當我嘗試使用聲吶測試結果時,我遇到了一個問題。

當我將屬性sonar.cs.vstest.reportsPaths設置爲trx文件的絕對文件時,它會將我的測試結果發佈到聲納。

但是當我使用通配符時,我的測試結果不會在聲納中發佈。 不太好

配置我試過。


#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 

滿配置




# ----- 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=. 

+0

您是否對您的問題有任何更新? – rajcool111 2015-07-05 21:47:07

+0

我試過使用「sonar.cs.vstest.reportsPaths = TestResults/*。trx」,但沒有運氣。 – rajcool111 2015-07-05 21:47:34

回答

1

當我指定它的工作原理完整的文件名。 例如, sonar.cs.vstest.reportsPaths = C:/MyTestSoln/TestResults/MyTest.trx

但是當我嘗試 「sonar.cs.vstest.reportsPaths = TestResults /它不工作*。 trx「

0

您需要提供.trx文件的完整路徑。

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