Skip to content

Commit

Permalink
Merge pull request #292 from manicmaniac/output-lcov
Browse files Browse the repository at this point in the history
Report coverage in lcov format for vscode-coverage-gutters
  • Loading branch information
manicmaniac authored Feb 17, 2025
2 parents d8ffdf6 + d270ae3 commit 49ccb37
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
env:
CC_TEST_REPORTER_ID: dummy # https://github.com/codeclimate/test-reporter/issues/495
- name: Format coverage
run: ./cc-test-reporter format-coverage --input-type simplecov --output 'codeclimate-${{ matrix.ruby-version }}.json'
run: ./cc-test-reporter format-coverage --input-type lcov --output 'codeclimate-${{ matrix.ruby-version }}.json'
- uses: actions/upload-artifact@v4
with:
name: coverages-ruby-${{ matrix.ruby-version }}
Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ gem 'rspec', '~> 3.13'
gem 'rubocop', '~> 1.60', require: false
gem 'rubocop-rake', '~> 0.6', require: false
gem 'rubocop-rspec', '~> 3.0', require: false
gem 'simplecov', '~> 0.22', require: false
gem 'simplecov', '~> 0.22'
gem 'simplecov-lcov', '~> 0.8.0'
gem 'yard', '~> 0.9', require: false
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ GEM
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov-lcov (0.8.0)
simplecov_json_formatter (0.1.4)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
Expand Down Expand Up @@ -208,6 +209,7 @@ DEPENDENCIES
rubocop-rake (~> 0.6)
rubocop-rspec (~> 3.0)
simplecov (~> 0.22)
simplecov-lcov (~> 0.8.0)
yard (~> 0.9)

BUNDLED WITH
Expand Down
8 changes: 8 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,17 @@
require 'pry'
require 'rspec'
require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |config|
config.report_with_single_file = true
config.output_directory = 'coverage'
config.lcov_file_name = 'lcov.info'
end
SimpleCov.start do
load_profile 'test_frameworks'
enable_coverage :branch
formatter SimpleCov::Formatter::MultiFormatter.new([SimpleCov::Formatter::LcovFormatter,
SimpleCov::Formatter::HTMLFormatter])
end
require 'danger_plugin'
require 'support/helpers'
Expand Down

0 comments on commit 49ccb37

Please sign in to comment.