【发布时间】:2019-04-30 00:44:57
【问题描述】:
我已将 dotCover 设置为使用 .xml 运行
<?xml version="1.0" encoding="utf-8"?>
<CoverageParams>
<TargetExecutable>
c:\dotcover\xunit\xunit.console.exe
</TargetExecutable>
<TargetArguments>
"INWK.Configuration.UnitTests.dll"
</TargetArguments>
<TargetWorkingDir>
..\bin\x64\Debug\
</TargetWorkingDir>
<TempDir>
<!-- Directory for auxiliary files. Set to the system temp by default. -->
</TempDir>
<Output>
dotCover-xunit.dcvr
</Output>
<InheritConsole>
<!-- [True|False] Lets the application being analyzed to inherit dotCover console. True by default. -->
</InheritConsole>
</CoverageParams>
您可以看到(Service、Shared、UnitTests 程序集正确包含在测试覆盖率报告中(Shared、Service 和 UnitTest 程序集)
但是,在构建服务器上运行相同的 *Service 和 *Shared 时丢失。
在将 Service.dll 和 Shared.dll 及其“pdb”从本地副本替换到构建服务器并在构建服务器上再次运行 dotCover 后,它可以正常工作。
这让我相信,在本地运行构建时,构建服务器运行程序的作用与 VS 中的 msbuild.exe 不同。
我在这里发现了非常相似的问题描述:https://stackoverflow.com/questions/25855131/dotcover-and-xunit-not-gathering-coverage-statistics-in-some-environments,但不确定如何在我的构建服务器配置中解决这个问题。
跟踪日志输出(一个驱动器) https://1drv.ms/t/s!AtxuuqGHIqXwgTVqQJ_Y_-rGE8W9?e=HrZgj7
【问题讨论】:
标签: msbuild continuous-integration resharper tfsbuild dotcover