C#Coverlet结果始终为空

达伦·奥基

具有.net核心3.1 Microsoft.net.sdk项目,并具有许多异步xUnit测试。

  • 尝试过-将coverlet.msbuild 2.9.0添加到项目中,然后运行:dotnet test Common\Common.csproj /p:CollectCoverage=true /显示100%,但是创建了一个空的coverage文件
  • 尝试过-将Coverlet.collector 1.3.0添加到项目中,然后运行:dotnet test Common\Common.csproj --collect:"XPlat Code Coverage"在testresults \ {guid} \ coverage.cobertura.xml中创建了一个文件-但它只是说lines-covered = 0

而stdout表示88次测试在4秒钟内运行。我究竟做错了什么?

叶甫尼·提姆钦

对我来说,coverlet.msbuild与命令完美结合: dotnet test Common\Common.csproj /p:CollectCoverage=true /p:IncludeTestAssembly=true /p:CoverletOutputFormat=cobertura /p:ExcludeByFile=\"**/Microsoft.NET.Test.Sdk.Program.cs\"

因此,我想您在这里错过了CoverletOutputFormat。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章