Use `Lcov` simplecov formatter on CI and `HTML` elsewhere (#27859)

th-new
Matt Jankowski 2023-11-15 04:11:02 -05:00 committed by GitHub
parent 998f068499
commit 7c72944661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -2,9 +2,14 @@
if ENV['DISABLE_SIMPLECOV'] != 'true' if ENV['DISABLE_SIMPLECOV'] != 'true'
require 'simplecov' require 'simplecov'
require 'simplecov-lcov'
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true if ENV['CI']
SimpleCov.formatter = SimpleCov::Formatter::LcovFormatter 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 SimpleCov.start 'rails' do
enable_coverage :branch enable_coverage :branch
enable_coverage_for_eval enable_coverage_for_eval