Move flatware setup into rails_helper (#38944)

This commit is contained in:
Matt Jankowski authored and GitHub committed 2026-05-12 13:12:49 +00:00
1 parent 735a00d741
commit a547dfff37
3 files changed
+10 -13

No files matched your search

+1 -1
View File
@@ -163,7 +163,7 @@ jobs:
rspec-persistence-main
rspec-persistence
- run: bin/flatware rspec -r ./spec/flatware_helper.rb
- run: bin/flatware rspec
- name: Upload coverage reports to Codecov
if: matrix.ruby-version == '.ruby-version'
-12
View File
@@ -1,12 +0,0 @@
# frozen_string_literal: true
if defined?(Flatware)
Flatware.configure do |config|
config.after_fork do |test_env_number|
if ENV.fetch('COVERAGE', false)
require 'simplecov'
SimpleCov.at_fork.call(test_env_number) # Combines parallel coverage results
end
end
end
end
+9
View File
@@ -6,6 +6,9 @@ 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
@@ -26,6 +29,12 @@ if ENV.fetch('COVERAGE', false)
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
# This needs to be defined before Rails is initialized