Move flatware setup into rails_helper (#38944)
This commit is contained in:
parent
735a00d741
commit
a547dfff37
2
.github/workflows/test-ruby.yml
vendored
2
.github/workflows/test-ruby.yml
vendored
@ -163,7 +163,7 @@ jobs:
|
|||||||
rspec-persistence-main
|
rspec-persistence-main
|
||||||
rspec-persistence
|
rspec-persistence
|
||||||
|
|
||||||
- run: bin/flatware rspec -r ./spec/flatware_helper.rb
|
- run: bin/flatware rspec
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
if: matrix.ruby-version == '.ruby-version'
|
if: matrix.ruby-version == '.ruby-version'
|
||||||
|
|||||||
@ -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
|
|
||||||
@ -6,6 +6,9 @@ if ENV.fetch('COVERAGE', false)
|
|||||||
require 'simplecov'
|
require 'simplecov'
|
||||||
|
|
||||||
SimpleCov.start 'rails' do
|
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']
|
if ENV['CI']
|
||||||
require 'simplecov-lcov'
|
require 'simplecov-lcov'
|
||||||
formatter SimpleCov::Formatter::LcovFormatter
|
formatter SimpleCov::Formatter::LcovFormatter
|
||||||
@ -26,6 +29,12 @@ if ENV.fetch('COVERAGE', false)
|
|||||||
add_group 'Services', 'app/services'
|
add_group 'Services', 'app/services'
|
||||||
add_group 'Validators', 'app/validators'
|
add_group 'Validators', 'app/validators'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if defined?(Flatware)
|
||||||
|
Flatware.configure do |config|
|
||||||
|
config.after_fork { |test| SimpleCov.at_fork.call(test) } # Combines parallel coverage results
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# This needs to be defined before Rails is initialized
|
# This needs to be defined before Rails is initialized
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user