我们正在使用InspectCode Resharper插件来生成C#代码分析报告,使用Opencover来生成代码覆盖报告(单元测试用例)。
这两个命令在Teamcity中一个接一个地运行。当我们生成Resharper分析报告并推送到声纳qube时,我们就会丢失代码覆盖率报告。
问题是如何将两个命令合并为一个脚本或合并两个命令的输出。
这些是我们执行的命令。
OpenCover命令:
F:\BuildSystem\Dependencies\Sonar\OpenCover\4.5.3522\OpenCover.Console.exe -register:user -target:F:\BuildSystem\Dependencies\NUnit\nunit-console-x86.exe -targetargs:"F:\Builds\Sonar\Helix_Sonar_EsdPaymentsBpay\UnitTests\bin\Debug\DummyProject.UnitTests.dll /noshadow" -excludebyattribute:"*.ExcludeFromCodeCoverage*|*.GeneratedCode*" -filter:"+[DummyProject*]* +[App.*]* -[*Tests*]*" -hideskipped:All -mergebyhash -output:coverage-report.xmlInspectCode公司
D:\sonar\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe begin /k:"dummy_project" /n:"dummy_project" /v:"sonarqube_project_version" /d:sonar.resharper.cs.reportPath="c:\resharper.xml" /d:sonar.resharper.solutionFile="dummyproject.sln"
"C:\Program Files (x86)\MSBuild\14.0\Bin\msbuild" "D:\CommSee2010\Neon\wwwroot\Apps\dummyproject\dev\dummyproject.sln"
"d:\sonar\jetbrains-commandline-tools\inspectcode.exe" /output="c:\resharper.xml" "D:\CommSee2010\Neon\wwwroot\Apps\dummyproject\dev\dummyproject.sln"
D:\sonar\MSBuild.SonarQube.Runner-1.0\MSBuild.SonarQube.Runner.exe end最终解决方案:
"D:\sonar\MSBuild.SonarQube.Runner-2.0\MSBuild.SonarQube.Runner.exe" begin /k:"OFI.CS" /n:"OFI.CS" /v:"1" /d:sonar.cs.opencover.reportsPaths="D:\sonar\output\ofi.Report.opencover.xml" /d:sonar.cs.nunit.reportsPaths="D:\sonar\output\TestResult.xml" /d:sonar.resharper.cs.reportPath="D:\sonar\output\ofi.Report.xml" /d:sonar.resharper.solutionFile="D:\hx\wwwroot\apps\test\dev\test.sln"
"C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" "D:\hx\wwwroot\apps\test\dev\test.sln"
"C:\Program Files (x86)\OpenCover\OpenCover.Console.exe" -register:user -target:"C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console-x86.exe" -targetargs:"D:\hx\wwwroot\apps\test\dev\UnitTests\bin\Debug\UnitTests.dll /noshadow /xml:D:\sonar\output\TestResult.xml" -filter:"" -mergebyhash -output:"d:\sonar\output\ofi.Report.opencover.xml"
"D:\sonar\resharper\inspectcode.exe" /output="D:\sonar\output\ofi.Report.xml" /profile="D:\hx\wwwroot\apps\test\dev\test.sln.DotSettings" "D:\hx\wwwroot\apps\test\dev\test.sln"
"D:\sonar\MSBuild.SonarQube.Runner-2.0\MSBuild.SonarQube.Runner.exe" end发布于 2016-02-17 21:25:00
您需要将OpenCover输出文件上传到声纳。
/d:sonar.cs.opencover.reportsPaths="coverage-report.xml"https://stackoverflow.com/questions/35448801
复制相似问题