rails/railties/test
eileencodes c1a215a06b
Add schema cache tests
The schema cache tests test the following scenarios:

1) The default case works (single db, primary spec name (dev is default
to primary in 2-tier config), standard default schema cache filename)
2) Primary always wins over other entries
3) A custom schema cache filename works when set in the configuration
4) A custom schema cache filename works when set in the ENV

Cases that don't work:

1) A non-primary database entry picks up a namespaced schema cache file

This can't work currently because there's no way of knowing which cache
we actually want. In this railtie we can only load ActiveRecord::Base's
schema cache. If we grab the first config we risk loading a cache for
another connection because order is not guaranteed.

2) Multi-db schema caches

The reasons are similar to above. In addition we can't loop through the
configs, establish a connection, and load the cache because we don't
know what parent class to establish a connection to. In that case AR
Base will always get the cache and it would cause the last one to win
and therefore be loaded on the wrong connection.

The real fix for these issues is to get rid of the railtie entirely, but
for now we needed to set this back to what the behavior was before
recent changes but with the ability to pass a custom key.

Co-authored-by: Katrina Owen <kytrinyx@github.com>
2020-02-13 09:06:18 -05:00
..
application Add schema cache tests 2020-02-13 09:06:18 -05:00
command Fix deeply nested namespace command printing 2019-01-24 12:28:43 -05:00
commands remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
configuration Delayed middleware delete does not allow move operations 2020-01-08 11:30:02 +02:00
engine Use the single line editor in console test 2019-12-24 20:47:21 +09:00
fixtures/lib Remove unused fixtures 2017-09-26 07:45:42 +09:00
generators Merge pull request #37516 from jonathanhefner/generator-generate-avoid-shell-out 2020-02-09 23:29:23 +01:00
isolation Run yarn install in template dir 2019-11-14 16:47:08 -08:00
minitest rubocop single space after assignment 2018-02-19 11:23:47 +05:30
railties Make Rails::Configuration::Generators accessor consistent 2019-12-20 06:21:09 +09:00
test_unit Show rails instead of bin/rails on USAGE instructions 2018-07-06 22:46:54 +02:00
abstract_unit.rb Revert "You give jruby_skip & rubinius_skip a good name" 2019-08-02 00:24:11 -04:00
app_loader_test.rb Turn on performance based cops 2018-07-23 15:37:06 -07:00
backtrace_cleaner_test.rb Don't modify relative ./ paths in BacktraceCleaner 2019-10-03 14:06:58 -07:00
code_statistics_calculator_test.rb use "minitest" consistently 2018-09-11 23:57:25 +02:00
code_statistics_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
console_helpers.rb Enable Performance/UnfreezeString cop 2018-09-23 08:56:55 +09:00
engine_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
env_helpers.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
generators_test.rb remove reference to global rails command and replace with bin/rails 2019-12-27 19:32:37 +00:00
initializable_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
json_params_parsing_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00
path_generation_test.rb Remove deprecated config.secret_token 2019-01-17 16:08:34 -05:00
paths_test.rb Use assert_predicate and assert_not_predicate 2018-01-25 23:32:59 -05:00
rack_logger_test.rb Change the empty block style to have space inside of the block 2018-09-25 13:19:35 -04:00
rails_info_controller_test.rb Fix secret_key_base for Railties 2019-03-13 16:41:29 -04:00
rails_info_test.rb Revert "Merge pull request #34387 from yhirano55/rails_info_properties_json" 2019-01-08 22:21:20 +01:00
secrets_test.rb Enable Style/RedundantBegin cop to avoid newly adding redundant begin block 2018-12-21 06:12:42 +09:00
version_test.rb Adding frozen_string_literal pragma to Railties. 2017-08-14 19:08:09 +02:00