Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix repo coverage #2467

Merged
merged 2 commits into from
Jun 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

if ENV['GITHUB_USER'] # only when running CI
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end

SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
end

SimpleCov.start do
add_filter '/spec/'
end
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#### Fixes

* [#2467](https://github.com/ruby-grape/grape/pull/2467): Fix repo coverage - [@ericproulx](https://github.com/ericproulx).
* Your contribution here.

### 2.1.2 (2024-06-28)
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ group :test do
gem 'rack-test', '~> 2.1'
gem 'rspec', '~> 3.13'
gem 'ruby-grape-danger', '~> 0.2', require: false
gem 'simplecov', '~> 0.21'
gem 'simplecov-lcov', '~> 0.8'
gem 'simplecov', '~> 0.21', require: false
gem 'simplecov-lcov', '~> 0.8', require: false
gem 'test-prof', require: false
end

Expand Down
18 changes: 1 addition & 17 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# frozen_string_literal: true

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'support'))

require 'simplecov'
require 'rubygems'
require 'bundler'
Bundler.require :default, :test

require 'grape'

Grape.deprecator.behavior = :raise

%w[config support].each do |dir|
Expand All @@ -27,21 +22,10 @@
config.include Spec::Support::Helpers
config.raise_errors_for_deprecations!
config.filter_run_when_matching :focus
config.warnings = true

config.before(:all) { Grape::Util::InheritableSetting.reset_global! }
config.before { Grape::Util::InheritableSetting.reset_global! }

# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = '.rspec_status'
end

require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = 'coverage/lcov.info'
end

SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
SimpleCov.start