Sha256: b09f9a2d6ebf8aeb0bd93ba1feb59eb571a92087c536059eed81f71aa0d843da
Contents?: true
Size: 1.07 KB
Versions: 64
Compression:
Stored size: 1.07 KB
Contents
namespace :ci do namespace :simplecov do desc 'setup' task :setup do # Usage: bundle exec rake ci:simplecov:setup test require 'simplecov' require 'ndr_dev_support/rake_ci/simple_cov_helper' SimpleCov.at_exit do result = SimpleCov.result result.format! if ENV['RAKECI_HEADLESS'].nil? NdrDevSupport::RakeCI::SimpleCovHelper.new.save_current_result(result) end SimpleCov.start end desc 'process' task :process do require 'simplecov' require 'ndr_dev_support/rake_ci/simple_cov_helper' helper = NdrDevSupport::RakeCI::SimpleCovHelper.new result = helper.load_current_result next if result.nil? metrics = [ { name: 'simplecov_covered_percent', type: :gauge, value: result.covered_percent }, { name: 'simplecov_covered_lines', type: :gauge, value: result.covered_lines }, { name: 'simplecov_total_lines', type: :gauge, value: result.total_lines } ] @metrics ||= [] @metrics.concat(metrics) puts metrics.inspect end end end
Version data entries
64 entries across 64 versions & 1 rubygems