Skip to content

Force eager loading of the application code for specs require it

Bogdan Denkovych requested to merge force-eager_load-for-specs-require-it into master

What does this MR do and why?

Force eager loading of the application code for specs require it

In !72964 (merged) we disabled eager loading for the test environment. As it was mentioned there are specs that depend on all the application that is being loaded. See !72964 (comment 713060754)

This MR introduces :eager_load rspec tag and adds this tag to specs that require it. There are still might be some specs that require this tag. This MR do not address all the cases from #343878. Those two still need further investigation:

Adding this tag to the spec would make Rails.application.eager_load! be called before its execution to load the application code. See https://api.rubyonrails.org/classes/Rails/Application.html#method-i-eager_load-21

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports