Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implicit config for test env #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lazureykis
Copy link

@lazureykis lazureykis commented Nov 20, 2023

Here is the problem with Rails 7.1 and this gem configuration. With Rails 7.1, in test environment, we always will see warning about cache format, because this gem creates cache store before rails app was initialized.

rails -v # -> Rails 7.1.2
rails new testapp && cd testapp && bundle add graphql-fragment_cache
RAILS_ENV=test bin/rails c

DEPRECATION WARNING: Support for `config.active_support.cache_format_version = 6.1` has been deprecated and will be removed in Rails 7.2.

Check the Rails upgrade guide at https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#new-activesupport-cache-serialization-format
for more information on how to upgrade.
 (called from block (2 levels) in require at /Users/lazureykis/.asdf/installs/ruby/3.2.2/lib/ruby/site_ruby/3.2.0/bundler/runtime.rb:60)
Loading test environment (Rails 7.1.2)
irb(main):001>

Copy link
Owner

@DmitryTsepelev DmitryTsepelev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should do something like

if rails_version >= 7
  config.active_support.cache_format_version = 7.0
end

Otherwise it will require real store to run specs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants