Skip to content

Commit

Permalink
Configure config.active_support.cache_format_version = 7.1 for `Rai…
Browse files Browse the repository at this point in the history
…ltieTest`

This commit suppresses the `DEPRECATION WARNING: Support for `config.active_support.cache_format_version = 6.1`
has been deprecated and will be removed in Rails 7.2.` warning at `RailtieTest`

This commit sets `config.active_support.cache_format_version = 7.1` explicitly for `RailtieTest`
because #48598 deprecates `active_support.cache_format_version = 6.1` and still the default format_version is 6.1, I think this is intended.

https://github.com/rails/rails/blob/4ac237de74a1ff383a44f6dc04c0e8894633722b/activesupport/lib/active_support/cache.rb#L55

```
    @format_version = 6.1
```

\### Steps to reproduce
```
git clone https://github.com/rails/rails
cd rails/activemodel
bundle
bin/test test/cases/railtie_test.rb:21
```

\### Without this commit
```
$ bin/test test/cases/railtie_test.rb:21
Run options: --seed 36872

\# Running:

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 (3 levels) in run at /home/yahonda/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/minitest-5.19.0/lib/minitest/test.rb:94)
.

Finished in 0.321429s, 3.1111 runs/s, 3.1111 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
$
```

\### With this commit
```
$ bin/test test/cases/railtie_test.rb:21
Run options: --seed 65282

\# Running:

Finished in 0.006108s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
$
```
  • Loading branch information
yahonda committed Aug 25, 2023
1 parent 4ac237d commit 2ab10fa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions activemodel/test/cases/railtie_test.rb
Expand Up @@ -15,6 +15,7 @@ def setup
@app ||= Class.new(::Rails::Application) do
config.eager_load = false
config.logger = fake_logger
config.active_support.cache_format_version = 7.1
end
end

Expand Down

0 comments on commit 2ab10fa

Please sign in to comment.