Minor performance improvement for test suite (#4678)
This commit is contained in:
parent
fbe1115114
commit
c66fe2aeba
3 changed files with 20 additions and 3 deletions
|
@ -1,11 +1,15 @@
|
|||
require 'simplecov'
|
||||
|
||||
GC.disable
|
||||
|
||||
SimpleCov.start 'rails' do
|
||||
add_group 'Services', 'app/services'
|
||||
add_group 'Presenters', 'app/presenters'
|
||||
add_group 'Validators', 'app/validators'
|
||||
end
|
||||
|
||||
gc_counter = -1
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.expect_with :rspec do |expectations|
|
||||
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
||||
|
@ -22,8 +26,21 @@ RSpec.configure do |config|
|
|||
end
|
||||
|
||||
config.after :suite do
|
||||
gc_counter = 0
|
||||
FileUtils.rm_rf(Dir["#{Rails.root}/spec/test_files/"])
|
||||
end
|
||||
|
||||
config.after :each do
|
||||
gc_counter += 1
|
||||
|
||||
if gc_counter > 19
|
||||
GC.enable
|
||||
GC.start
|
||||
GC.disable
|
||||
|
||||
gc_counter = 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def body_as_json
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue