gpt4 book ai didi

TeamCity 9.0.1 - 并非所有程序集都显示在覆盖分割中

转载 作者:行者123 更新时间:2023-12-05 06:44:36 24 4
gpt4 key购买 nike

我有一个由多个项目组成的 Visual Studio 解决方案。我在 TeamCity 中为它设置了一个构建过程,并且添加了一个 NUnit runner 构建步骤,具有以下设置:

  • nunit 运行器 2.6.3
  • 从以下位置运行测试:%teamcity.build.workingDir%\Sources\**\bin\*.Web.UnitTests.dll
  • .net 覆盖工具:JetBrains dotCover
  • 过滤器:--空--

在构建的代码覆盖率选项卡中,在覆盖率分割下,我只能看到:

  • 我的项目.Domain
  • MyProject.Web.UnitTests

MyProject.Web、测试对象和解决方案中的一些其他程序集不会显示在那里,并且会被 dotCover 代码覆盖率计算忽略。为什么?我如何告诉它使用哪些程序集?

我在“过滤器”字段中尝试了各种 +:/-: 组合均未成功。但是在过滤器为空的情况下,我希望包含 MyProject.Web,因为 MyProject.Domain 是 - 为什么不包含它?

最佳答案

您是在 Release模式还是 Debug模式下构建?我在使用 Release模式时遇到了同样的问题,并且必须启用 PDB 输出,这是 dotCover 确定代码覆盖率所需要的。默认情况下,发布版本不启用 PDB。

要启用它,请转到“项目设置”->“构建”->“高级”(底部的按钮)->“调试信息”->选择“pdb-only”或“full”。

此外,dotCover 在无法确定代码覆盖率时提供此声明。检查列出的所有原因可能会有所帮助:

No executable code was detected.

The issue could be caused by one of the following:

  • Include / exclude patterns are incorrect
  • Assemblies are compiled without debugging information
  • .pdb files are not available
  • Visual Studio code coverage is enabled for MSTest
  • .testrunconfig is used for MSTest and Visual Studio code coverage is not disabled (CodeCoverage section with enable="true" is present)

关于TeamCity 9.0.1 - 并非所有程序集都显示在覆盖分割中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28503758/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com