RCov不起作用

时间:2009-12-18 10:58:21

标签: ruby metrics rcov metric-fu

我目前正在开发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

你有一些提示吗?

祝你好运

1 个答案:

答案 0 :(得分:0)

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

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所做的)。

希望有所帮助。