【问题标题】:RCov doesn't workRCov 不起作用
【发布时间】:2009-12-18 10:58:20
【问题描述】:

我目前正在开发一个 Ruby gem 并希望创建指标。

我正在使用“metric_fu”,但 RCov 似乎超出了我的规范。

这是我的 metric_fu 配置:

MetricFu::Configuration.run do |config|
        config.metrics  = [:churn, :saikuro, :flog, :flay, :reek, :roodi, :rcov]
        config.graphs   = [:flog, :flay, :reek, :roodi, :rcov]
        config.flay     = { :dirs_to_flay => ['lib']  } 
        config.flog     = { :dirs_to_flog => ['lib']  }
        config.reek     = { :dirs_to_reek => ['lib']  }
        config.roodi    = { :dirs_to_roodi => ['lib'] }
        config.saikuro  = { :output_directory => 'scratch_directory/saikuro', 
                            :input_directory => ['lib'],
                            :cyclo => "",
                            :filter_cyclo => "0",
                            :warn_cyclo => "5",
                            :error_cyclo => "7",
                            :formater => "text"} #this needs to be set to "text"
        config.churn    = { :start_date => "1 year ago", :minimum_churn_count => 10}
        config.rcov     = { :test_files => ["spec/**/*_spec.rb"],
                            :rcov_opts => ["--sort coverage", 
                                           "--no-html", 
                                           "--text-coverage",
                                           "--no-color",
                                           "--profile",
                                           "--spec-only",
                                           "--exclude /gems/,/Library/,spec"]}
end

你有什么建议吗?

最好的问候

【问题讨论】:

  • 您运行的是哪个版本的“metric_fu”?你在你的环境文件中做过“config.gem”吗?在您的 Rake 文件中,您是否添加了“require 'metric_fu'”?
  • 您收到的错误信息是什么?

标签: ruby metrics rcov metric-fu


【解决方案1】:

如果没有堆栈跟踪,这将很难诊断,但我建议将您的配置更改为:

MetricFu::Configuration.run do |config|
        config.metrics  = [:rcov]
        config.graphs   = [:rcov]
        config.rcov     = { :test_files => ["spec/**/*_spec.rb"],
                            :rcov_opts => ["--sort coverage", 
                                           "--no-html", 
                                           "--text-coverage",
                                           "--no-color",
                                           "--profile",
                                           "--spec-only",
                                           "--exclude /gems/,/Library/,spec"]}
end

这样您就可以隔离问题。然后运行“rake metrics:all --trace”,如果你无法从那里弄清楚,请在此处或 metric_fu google 组发布结果:http://groups.google.com/group/metric_fu

您也可以尝试直接从命令行运行 rcov(本质上就是 metric_fu 所做的)。

希望对您有所帮助。

【讨论】:

    猜你喜欢
    • 2012-10-30
    • 1970-01-01
    • 2010-11-18
    • 1970-01-01
    • 2011-03-04
    • 1970-01-01
    • 2011-03-27
    • 1970-01-01
    • 2015-04-10
    相关资源
    最近更新 更多