声纳没有选择 Visual Studio 测试报告路径 [英] Sonar not picking up the visual studio test report paths
问题描述
我们正在 TFS (2010) 团队构建上运行 SonarQube(5.0.1) 和 sonar.net-runner.
We are running SonarQube(5.0.1), with sonar.net-runner on a TFS (2010) team build.
FxCop 工作正常,一切运行完美,我在声纳中看到所有问题.
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.
当我将属性 sonar.cs.vstest.reportsPaths
设置为 trx
文件的绝对文件时,它会将我的测试结果发布到声纳.很棒.
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
我尝试过的配置.
#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=.
推荐答案
您需要提供 .trx 文件的完整路径.
You need to provide full path to .trx file.
sonar.cs.vstest.reportsPaths=../TestResults/TestResult.trx
这篇关于声纳没有选择 Visual Studio 测试报告路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!