无法禁用DevOps管道代码覆盖率报告。

huangapple go评论83阅读模式
英文:

Can't disable DevOps pipeline code coverage report

问题

我想要禁用在PR上显示的DevOps代码覆盖率报告,因为我正在使用第三方工具作为质量门槛。

Microsoft文档建议您可以在yaml管道配置中关闭覆盖状态,如下所示(参见示例):

coverage:
  status: off

然而,没有提供完整的yaml示例,所以不清楚应该在管道定义的哪个位置包含它。我假设它应该像这样使用:

trigger:
- main

coverage:
  status: off

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: echo "My DevOps Pipeline"

不幸的是,尝试运行上述管道时,我收到以下错误:

未预期的属性coverage

这个功能是否已被弃用,或者有其他人成功禁用了覆盖状态?

英文:

I want to disable the DevOps code coverage report that shows on PRs as I'm using a 3rd party tool as a quality gate.

The Microsoft documentation suggests you can turn the coverage status off in the yaml pipeline configuration like this (see example):

coverage:
  status: off

However a complete yaml example isn't provided so it's not clear where in the pipeline definition it should be included. I presume it's intended to be used like this:

trigger:
- main

coverage:
  status: off

pool:
  vmImage: 'ubuntu-latest'

steps:
- script: echo "My DevOps Pipeline"

Unfortunately when trying to run the above pipeline I get the following error:

> Unexpected property coverage

Is this feature deprecated or has someone else managed to disable the coverage status?

答案1

得分: 0

你所发布的文档讨论了有关拉取请求的代码覆盖率体验的默认设置。这是在存储库根目录中的单独 azurepipelines-coverage.yml 中配置的,而不是在管道 YAML 中。

> 如果您想更改拉取请求的代码覆盖率体验的默认设置,必须在存储库的根目录下包含一个名为 azurepipelines-coverage.yml 的配置 YAML 文件。在此文件中设置所需的值,它将在下次运行管道时自动使用。

从您在问题中发布的文档链接

英文:

The documentation you posted is talking about the default setting of the code coverage experience for pull requests. This is configured in a separate azurepipelines-coverage.yml at the root of your repo and not in the pipeline YAML.

> If you would like to change the default settings of the code coverage experience for pull requests, you must include a configuration YAML file named azurepipelines-coverage.yml at the root of your repo. Set the desired values in this file and it will be used automatically the next time the pipeline runs.

From the documentation link you posted in your question

huangapple
  • 本文由 发表于 2023年7月20日 08:18:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76725935.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定