简体   繁体   English

SimpleCov代码覆盖率与Jenkins的最后一次构建相比较

[英]SimpleCov code coverage comparize with last build in Jenkins

I have situation where I want to compare code coverage of last Jenkins build from current Jenkins build so if current Jenkins build code coverage is low then last one , build should unstable or failed 我有这种情况,我想比较当前Jenkins构建的最后Jenkins构建的代码覆盖率,所以如果当前Jenkins构建代码覆盖率低于最后一个,构建应该不稳定或失败

Is that possible with any Jenkins plugin or do I need to do some stuff with SimpleCov? 有可能使用任何Jenkins插件或者我需要用SimpleCov做一些事情吗?

You can use the RUbyMetrics Jenkins plugin: https://wiki.jenkins.io/display/JENKINS/RubyMetrics+plugin 您可以使用RUbyMetrics Jenkins插件: https ://wiki.jenkins.io/display/JENKINS/RubyMetrics+plugin

along with with simplecov-json and simplecov-rcov gems. 以及simplecov-rcov simplecov-jsonsimplecov-rcov宝石。

So you need to add this to your rspec_helper : 所以你需要将它添加到你的rspec_helper

require 'simplecov'
require 'simplecov-json'
require 'simplecov-rcov'

SimpleCov.formatters = [
  SimpleCov::Formatter::HTMLFormatter,
  SimpleCov::Formatter::JSONFormatter,
  SimpleCov::Formatter::RcovFormatter
]
SimpleCov.start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM