【问题标题】:TFS 2012 Code Coverage Generated But Not Displayed In Report or Build Summary已生成 TFS 2012 代码覆盖率,但未显示在报告或构建摘要中
【发布时间】:2016-01-23 05:43:23
【问题描述】:

我正在尝试让代码覆盖率结果显示在构建摘要和 TFS 构建摘要报告中。我在 CI 构建中包含了一个 .testsettings 文件来检测我感兴趣的程序集。

这是我在构建摘要中看到的(未显示实际名称):

0 error(s), 332 warning(s)
name1.sln ('publish;build' target(s)) - 0 error(s), 15 warning(s), View Log File
name2.sln - 0 error(s), 184 warning(s), View Log File
testsolution.sln - 0 error(s), 133 warning(s), View Log File
3 projects/solutions compiled
1 test run completed - 100% pass rate
No Code Coverage Results

现在,这个“无代码覆盖结果”让我感到困惑。如果我下载测试结果,代码覆盖率就会出现在那里。另外,我可以在我们的构建服务器上查看 data.coverage 文件。过去两天我一直在谷歌和堆栈溢出上搜索,但没有找到任何对我有用的解决方案。有没有人有关于如何让这个工作的建议? 我们正在使用 TFS 2012、VS 2012,并使用 MSTest 运行测试。

【问题讨论】:

    标签: visual-studio-2012 code-coverage mstest tfsbuild


    【解决方案1】:

    首先,编辑构建定义并将运行设置类型设置为 CodeCoverageEnabled。

    然后确保在“添加/编辑测试运行”对话框中选择了“启用代码覆盖”选项。保存构建定义,然后再次运行。

    另外,值得你看看这个链接中 Ralph Jansen 的回复:TFS 2013 - No Code Coverage Results

    【讨论】:

    • 感谢您的回复,但正如原始问题所述,我使用的是 MSTest,而不是 Visual Studio Test Runner。
    猜你喜欢
    • 1970-01-01
    • 2016-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-21
    • 2016-09-14
    • 2013-07-26
    相关资源
    最近更新 更多