Sonarqube 和 Cucumber 功能

标签 sonarqube cucumber

有没有办法在 SonarQube 分析中包含 Cucumber 特征的测试覆盖率和其他有用的统计数据?我做了一些研究,但找不到合适的插件。

最佳答案

来自 this thread (写在 OP 的问题之后),David Racadon 补充道:

As far as I understand:

  • It is not possible to run an analysis on a project containing only test code because the 'sonar.sources' property is mandatory.
    • Measures on test code are not aggregated at project level.
      As far as I am concerned, I consider test files part of the project the same way source files are. Thus, measures of test files should be aggregated on top of source files.
      For now, SonarQube shows that your project is 1,000 lines even if you have 0 or 10,000 lines of test code on top of those 1,000 lines of source code. For me, SonarQube gives you a biased estimate of the size of your project and the effort of maintenance.


最接近的就是他的插件 racodond/sonar-gherkin-plugin 哪一个:
  • 分析 Cucumber Gherkin feature files和:
  • 计算指标:代码行数、场景数量等。
  • 检查各种指南,通过 40 多次检查找出潜在的错误和代码异味
  • 提供编写自己的支票的能力
  • 关于Sonarqube 和 Cucumber 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41451484/

    相关文章:

    gradle - SonarQube gradle 插件因 ArrayIndexOutOfBounds 异常而失败

    jquery - Sonar 检查jquery代码错误

    java - Cucumber 升级后运行测试的问题

    java - 如果我的子步骤文件已经扩展了一个类,如何创建 MasterStep/BaseStep?

    jenkins - Sonarqube PLSQL 自定义规则,用于在 SQL 脚本文件中检测正确的 SQL 终止符分号

    SonarQube 以 143 退出

    android - Sonar Jacoco for Kotlin Setup 不生成代码覆盖率

    ruby-on-rails-3 - Rails 3 cucumber 加载错误

    ruby-on-rails - 如何正确配置rails测试以在浏览器中运行它? ( site_prism、 cucumber 、 capybara 、selenium webdriver )

    java - 如何将随机字符串转换为整数以派生另一个整数,然后将它们转换为字符串以发送到 JSON 有效负载