- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 Azure 上有一个 ReactJS 项目,我正在使用 Cobertura 发布代码覆盖率。
我见过像badge.io这样的工具可以用来获取徽章,但它似乎只能为公共(public)存储库提供徽章。如何在此私有(private) Azure 托管存储库的 readme.md 中获取徽章?
azure-pipelines.yml:
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
最佳答案
如果您没有覆盖率报告文件,则需要添加任务 reportgenerator (如果未安装,请在您的组织中安装此任务)在发布代码覆盖结果任务之前。请检查下面的示例
- task: reportgenerator@4
displayName: ReportGenerator
inputs:
reports: '$(System.DefaultWorkingDirectory)\TestCoverage.xml'
targetdir: '$(Build.SourcesDirectory)\TestResults\Coverage\Reports'
sourcedirs: '$(Build.SourcesDirectory)'
verbosity: Verbose
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '$(System.DefaultWorkingDirectory)\TestCoverage.xml'
pathToSources: '$(Build.SourcesDirectory)'
reportDirectory: '$(Build.SourcesDirectory)\TestResults\Coverage\Reports'
您希望徽章显示什么状态?
如果您想将构建状态徽章添加到存储库中的自述文件中。您可以查看here将状态徽章添加到您的存储库以了解构建状态。
更新:
因为 azure devops 测试结果中没有测试覆盖率徽章。您可以安装代码覆盖率扩展,例如。 code coverage protector或Code Coverage Widgets 。请按照下面的屏幕截图浏览市场并搜索代码覆盖率
当您从市场安装代码覆盖率扩展时。然后您可以Add a code coverage widgets to a dashboard .
您还可以submit a feature request (单击建议功能并选择 Azure Devops)向 Microsoft 开发团队提供测试覆盖率徽章。希望他们今后能够考虑并实现。
关于reactjs - 如何为 Azure 私有(private)存储库设置代码覆盖率徽章?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59631194/
在旧版 Web 应用程序中,我们没有对 javascript 部分进行任何单元测试。 我们希望提高代码质量并删除死代码。 有什么方法可以在人工测试期间在浏览器中进行逐行 Javascript 代码覆盖
我已经为我的 python 代码编写了测试,并且想检查测试覆盖了多少百分比,所以我决定使用 python 覆盖。但是我启动它时遇到问题。我用这个 bash 命令启动我的测试: export PYTHO
我正在使用 python 覆盖工具来运行我的单元测试。从结果中可以看出,它包括所有“站点包”。我怎样才能将它们排除在报告之外?我只想显示项目源代码的报告。 (ctrp) ubuntu@ubuntu-x
我正在尝试使用 Opencover 来运行 NUnit 测试用例的代码覆盖率。我得到了预期的结果,但问题是在执行 opencover 时它再次运行测试。我们不希望发生这种情况,因为我们单独运行测试。下
我正在尝试使用 Opencover 来运行 NUnit 测试用例的代码覆盖率。我得到了预期的结果,但问题是在执行 opencover 时它再次运行测试。我们不希望发生这种情况,因为我们单独运行测试。下
我有一个 python 项目,我使用: pipenv 毒性 pytest 还有更多。 基本上,我想将 tox 添加到我的 gitlab 管道中。几乎一切似乎都有效,从 tox 调用 mypy、flak
我使用Coverity来分析代码C。 配置命令: cov-configure --compiler /opt/toolchains/stbgcc-4.5.4-2.9/bin/mipsel-linux-
是否可以在运行时测量 python 代码覆盖率并在生成结果时查看结果?我尝试使用 coverage但找不到有帮助的选项。我最初的实验表明,.coverage 文件直到程序执行结束才被保存,这意味着我们
我有一个文件,test_basic.py: class TestCalculator(): def test_calculator(self): from basic impo
我有一个小型 PHP 项目,它使用 PHPUnit 进行单元测试和覆盖。我想生成 cobertura XML 格式的覆盖率报告。 我可以使用任何工具或插件来实现这一目标吗? 感谢任何帮助.. 最佳答案
我正在研究一个小 gem 并包含 simplecov到 spec_helper.rb 两行: require 'simplecov' SimpleCov.start 当我运行 rspec 测试时,si
go -cover 或 -coverprofile 在运行 go 测试时非常有用,并且可以在 html 或纯文本中很好地显示。但是是否有 api 以编程方式访问它或处理文件? 最佳答案 你可以试试ax
当我遇到代码覆盖问题时,我目前开始在 PHPUnit 中使用 strict 模式: 如果我使用setUp-方法创建我的类的新实例,__constructor-方法在我运行测试。 这是我的测试设置: p
我正在运行 EclEmma,它是 Eclipse 的 Emma 插件,覆盖率报告仅显示我定义的 Enum 的部分覆盖率,即使它显示 Enum 中唯一的值被覆盖。我假设支持 Enum 的隐含方法存在覆盖
我正在将 ANT 构建转换为 Maven。我不使用声纳。 在 Maven 中,Jacoco 似乎没有报告有关单元测试本身的覆盖率,而 ANT 则报告了。我也一直在尝试为我的 Maven 构建获取这个,
我正在努力为我正在处理的库实现 100% 的代码覆盖率,但我似乎对 switch 语句和覆盖率有一些问题,我根本不明白。 我目前使用的是 Jacoco 0.7.2,因为每个新版本似乎都与 Robole
有没有在intelliJ中不用浏览器运行代码覆盖率的方法? http://www.jetbrains.com/webstorm/webhelp/monitoring-code-coverage-for
我想确保我的 Django 测试套件涵盖我的 URL 配置中列出的所有 URL。有没有办法将 URL 配置中的列表与测试套件中命中的 URL 列表进行比较? 最佳答案 我能够通过定义自定义测试套件运行
哇,好乱啊。这是场景。 主干驱动的 JS 应用。 用于 AMD 功能的 RequireJS,初始化如下: 然后在 main.js 中添加以下配置代码: require.config( { p
我的问题很简单,但答案仍然难以捉摸。假设我有一个包裹 package mypackage func DoTheThing() int { return 5 } 现在假设我在 mypackage_t
我是一名优秀的程序员,十分优秀!