mirror of https://github.com/mastodon/mastodon
Move `simplecov` config into `rails_helper` (#30302)
parent
aad5e841b5
commit
6beead3867
@ -1,22 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
if ENV['CI']
|
||||
require 'simplecov-lcov'
|
||||
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
|
||||
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter
|
||||
else
|
||||
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
|
||||
end
|
||||
|
||||
SimpleCov.start 'rails' do
|
||||
enable_coverage :branch
|
||||
|
||||
add_filter 'lib/linter'
|
||||
|
||||
add_group 'Libraries', 'lib'
|
||||
add_group 'Policies', 'app/policies'
|
||||
add_group 'Presenters', 'app/presenters'
|
||||
add_group 'Serializers', 'app/serializers'
|
||||
add_group 'Services', 'app/services'
|
||||
add_group 'Validators', 'app/validators'
|
||||
end
|
@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# TODO: https://github.com/simplecov-ruby/simplecov/pull/1084
|
||||
# Patches this missing condition, monitor for upstream fix
|
||||
|
||||
module SimpleCov
|
||||
module SourceFileExtensions
|
||||
def build_branches
|
||||
coverage_branch_data = coverage_data.fetch('branches', {}) || {} # Add the final empty hash in case where 'branches' is present, but returns nil
|
||||
branches = coverage_branch_data.flat_map do |condition, coverage_branches|
|
||||
build_branches_from(condition, coverage_branches)
|
||||
end
|
||||
|
||||
process_skipped_branches(branches)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
SimpleCov::SourceFile.prepend(SimpleCov::SourceFileExtensions) if defined?(SimpleCov::SourceFile)
|
Loading…
Reference in New Issue