dev*_*per 5 teamcity mstest dotcover sonarqube
我正在尝试将单元测试和 dotCover 代码分析结果从 TeamCity 上传到声纳服务器。它在 TeamCity 中显示代码覆盖率和单元测试结果,但没有在 Sonar 上显示代码覆盖率/单元测试。
TeamCity 单元测试步骤:
其次是Powershell脚本:
我在 Sonar Runner 步骤中有以下附加参数:
Dsonar.cs.vstest.reportsPaths=TestResults.trc Dsonar.cs.dotcover.reportsPaths='%sonar.coverageReport%'
有谁知道如何解决这一问题?
谢谢。
在步骤 3 中使用以下脚本设法解决了该问题:
$Files= Get-ChildItem %system.teamcity.build.tempDir% `
-Filter coverage_dotcover*.data `
| where-object {$_.length -gt 50} `
| Select-Object -ExpandProperty FullName
$snapshot =[string]::Join(";",$Files)
& %teamcity.tool.dotCover%\dotCover.exe merge `
/Source=$snapshot `
/Output=%env.TEMP%\dotCoverReport.dcvr`
& %teamcity.tool.dotCover%\dotCover.exe report `
/Source=%env.TEMP%\dotCoverReport.dcvr `
/Output=%sonar.coverageReport% `
/ReportType=HTML
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3723 次 |
| 最近记录: |