getting simplecov up and running

58 visualizações
Pular para a primeira mensagem não lida

Carlos

não lida,
26 de set. de 2013, 16:46:5526/09/2013
para metr...@googlegroups.com
I am using ruby 2.0 and i have had a heck of time trying to get simplecov working with metric_fu.  I have configured simeplecov to format results in the rcov format.

The first issue was just getting metric_fu to just use the Rcov metric.  I think the .metrics snippet listed under "Using Coverage Metrics" was missing:

rcov.activate

MetricFu::Metric.enabled_metrics will only return a metric if is enabled and activated.

Unfortunately now i am running into the following error:

*****Executing HotspotsGenerator
/Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb:18:in `each': undefined method `+' for :percentage_uncovered:Symbol (NoMethodError)
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb:18:in `inject'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb:18:in `sum'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/scoring_strategies.rb:22:in `average'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/hotspot.rb:42:in `reduce'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:61:in `block in calculate_metric_scores'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:60:in `calculate_metric_scores'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:41:in `calculate_score_for_granularity'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:36:in `block in calculate_scores_by_granularities'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:35:in `each'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:35:in `calculate_scores_by_granularities'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:13:in `block in calculate_scores'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:12:in `each'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/analysis/rankings.rb:12:in `calculate_scores'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/hotspot_analyzer.rb:53:in `setup'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/hotspot_analyzer.rb:21:in `initialize'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/hotspots.rb:19:in `new'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/hotspots/hotspots.rb:19:in `analyze'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/generator.rb:100:in `block in generate_result'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/generator.rb:98:in `each'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/metrics/generator.rb:98:in `generate_result'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/reporting/result.rb:46:in `add'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/run.rb:21:in `block in measure'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/run.rb:19:in `each'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/run.rb:19:in `measure'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/run.rb:10:in `run'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/cli/helper.rb:11:in `run'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/lib/metric_fu/cli/client.rb:18:in `run'
from /Users/carlos/.rvm/gems/ruby-2.0.0-p247@azul/gems/metric_fu-4.4.3/bin/metric_fu:9:in `<top (required)>'
from /Users/carlos/development/projects/rails_projects/azul/bundler_stubs/metric_fu:16:in `load'
from /Users/carlos/development/projects/rails_projects/azul/bundler_stubs/metric_fu:16:in `<main>'

Any thoughts?

i am using:
- ruby 2.0.0 p247
- simplecov 0.7.1
- simplecov-rcov-text 0.0.2
- metric_fu 4.4.3

Carlos


Benjamin Fleischer

não lida,
26 de set. de 2013, 19:27:0826/09/2013
para metr...@googlegroups.com
Hi Carlos-

First of all, thanks for your report, here.  I think this should be an issue (or better, a pull request!) filed on metric_fu https://github.com/metricfu/metric_fu/issues?state=open  Let me know if you'd like me to do that.

I should also apologize for your troubles.  The Coverage support via RCov-formatted output is still a bit of a hack and not well-tested.  I'll see if I can duplicate the error myself.

Thanks for providing your gem and ruby versions.  For reference, the newest release of metric_fu now also has a --debug flag that print out debug info for copying and pasting. (Though it wouldn't include the simplecov* gems)

-Benjamin
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem