# Remove items from the common Gemfile that we don't need for this
# test run. This also requires handling some gemspecs.
rm ../Gemfile.lock || die
sed -i -e "/\(uglifier\|system_timer\|sdoc\|w3c_validators\|pg\|jquery-rails\|execjs\|'mysql'\|journey\|ruby-prof\|stackprof\|benchmark-ips\|kindlerb\|turbolinks\|coffee-rails\|debugger\|redcarpet\|minitest\|sprockets\|stackprof\)/ s:^:#:"\
-e '/:job/,/end/ s:^:#:'\
-e '/group :doc/,/^end/ s:^:#:' ../Gemfile || die
sed -i -e '/rack-ssl/d' -e 's/~> 3.4/>= 3.4/' ../railties/railties.gemspec || die
sed -e '/bcrypt/ s/3.0.0/3.0/'\
-i ../Gemfile || die
# Add back json in the Gemfile because we dropped some dependencies
# earlier that implicitly required it.
sed -i -e '$agem "json"' ../Gemfile || die
sed -i -e '2igem "railties", "~> 6.0.0"; gem "activemodel", "~> 6.0.0"' test/cases/helper.rb || die
# Avoid test depending on mysql adapter which we don't support for
# this Rails version to simplify our dependencies.
rm test/cases/connection_specification/resolver_test.rb || die
# Avoid single tests using mysql or postgres dependencies.
rm test/cases/invalid_connection_test.rb || die
sed -e '/test_switching_connections_with_database_url/askip "postgres"'\
-i test/cases/connection_adapters/connection_handlers_multi_db_test.rb || die
# Avoid failing test that makes bad assumptions on database state.
sed -i -e '/test_do_not_call_callbacks_for_delete_all/,/^ end/ s:^:#:'\