控制 Azure DevOps 中的代码覆盖率附件
Control code coverage attachments in Azure DevOps
在多阶段、yaml 配置的 CI 管道中,通过矩阵策略构建在 Windows 和 Linux 中,我正在生成:
Linuxos 中的 .cobertura.xml
文件,用于通过 ReportsGenerator 生成聚合报告,可从 AzureDevops 中的覆盖选项卡访问。我在 os.
中明确使用 PublishCodeCoverageResults
Windows os 中的 .coverage
文件,用于向 SonarCloud 提供覆盖数据。我没有在 os.
中使用 PublishCodeCoverageResults
我的问题是 .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.
在多阶段、yaml 配置的 CI 管道中,通过矩阵策略构建在 Windows 和 Linux 中,我正在生成:
Linuxos 中的
.cobertura.xml
文件,用于通过 ReportsGenerator 生成聚合报告,可从 AzureDevops 中的覆盖选项卡访问。我在 os. 中明确使用 Windows os 中的
.coverage
文件,用于向 SonarCloud 提供覆盖数据。我没有在 os. 中使用
PublishCodeCoverageResults
PublishCodeCoverageResults
我的问题是 .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.