控制 Azure DevOps 中的代码覆盖率附件

Control code coverage attachments in Azure DevOps

在多阶段、yaml 配置的 CI 管道中,通过矩阵策略构建在 Windows 和 Linux 中,我正在生成:

我的问题是 .coverage 文件覆盖了覆盖选项卡中的预期报告,允许我下载它而不是查看报告。我怎样才能避免这种情况?有什么方法可以删除该附件以正确显示报告?


如果我没有 运行 Windows 部分,报告是 shown as expected

如果我这样做,我会得到 this 而不是报告。

我尝试删除管道末尾的 .coverage 个文件,但覆盖选项卡中的 'attachment' 仍然存在。

据我了解,您想下载 avialble 而不是像这样显示代码覆盖率:

但是您的代码覆盖率也可以作为工件使用:

所以你仍然可以下载它:

对你有帮助吗?

已回答here

This is not a bug and the behavior is as designed as the .coverage report is given precedence over other reports.

My guidance would be to stop publishing the test run as part of the dotnet task in windows. There is an option to do so.

Copy the trx and coverage files out to separate locations. Upload the trx file using the publish test results task but make sure the coverage file is not available for this publish.