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

Version Path
ndr_dev_support-5.4.5 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.4.4 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.4.3 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.4.2 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.4.1 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.4.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.3.1 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.3.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.2.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.1.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.0.1 lib/tasks/ci/simplecov.rake
ndr_dev_support-5.0.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.2.1 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.2.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.1.3 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.1.2 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.1.1 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.1.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-4.0.0 lib/tasks/ci/simplecov.rake
ndr_dev_support-3.1.3 lib/tasks/ci/simplecov.rake