Remove flatware config block, re-extract simplecov config to standalone file (#39017)
This commit is contained in:
26
.simplecov
Normal file
26
.simplecov
Normal file
@@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
SimpleCov.start 'rails' do
|
||||
# During parallel runs, ensure unique names for post-run merge
|
||||
command_name "job-#{ENV['TEST_ENV_NUMBER']}" if ENV['TEST_ENV_NUMBER']
|
||||
|
||||
if ENV['CI']
|
||||
require 'simplecov-lcov'
|
||||
formatter SimpleCov::Formatter::LcovFormatter
|
||||
formatter.config.report_with_single_file = true
|
||||
else
|
||||
formatter SimpleCov::Formatter::HTMLFormatter
|
||||
end
|
||||
|
||||
enable_coverage :branch
|
||||
|
||||
add_filter 'lib/linter'
|
||||
|
||||
add_group 'Libraries', 'lib'
|
||||
add_group 'Policies', 'app/policies'
|
||||
add_group 'Presenters', 'app/presenters'
|
||||
add_group 'Search', 'app/chewy'
|
||||
add_group 'Serializers', 'app/serializers'
|
||||
add_group 'Services', 'app/services'
|
||||
add_group 'Validators', 'app/validators'
|
||||
end
|
||||
@@ -2,40 +2,7 @@
|
||||
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
|
||||
if ENV.fetch('COVERAGE', false)
|
||||
require 'simplecov'
|
||||
|
||||
SimpleCov.start 'rails' do
|
||||
# During parallel runs, ensure unique names for post-run merge
|
||||
command_name "job-#{ENV['TEST_ENV_NUMBER']}" if ENV['TEST_ENV_NUMBER']
|
||||
|
||||
if ENV['CI']
|
||||
require 'simplecov-lcov'
|
||||
formatter SimpleCov::Formatter::LcovFormatter
|
||||
formatter.config.report_with_single_file = true
|
||||
else
|
||||
formatter SimpleCov::Formatter::HTMLFormatter
|
||||
end
|
||||
|
||||
enable_coverage :branch
|
||||
|
||||
add_filter 'lib/linter'
|
||||
|
||||
add_group 'Libraries', 'lib'
|
||||
add_group 'Policies', 'app/policies'
|
||||
add_group 'Presenters', 'app/presenters'
|
||||
add_group 'Search', 'app/chewy'
|
||||
add_group 'Serializers', 'app/serializers'
|
||||
add_group 'Services', 'app/services'
|
||||
add_group 'Validators', 'app/validators'
|
||||
end
|
||||
|
||||
if defined?(Flatware)
|
||||
Flatware.configure do |config|
|
||||
config.after_fork { |test| SimpleCov.at_fork.call(test) } # Combines parallel coverage results
|
||||
end
|
||||
end
|
||||
end
|
||||
require 'simplecov' if ENV.fetch('COVERAGE', false)
|
||||
|
||||
# This needs to be defined before Rails is initialized
|
||||
STREAMING_PORT = ENV.fetch('TEST_STREAMING_PORT', '4020')
|
||||
|
||||
Reference in New Issue
Block a user