From 5280ba1345fbbbfce1e71a5b874918466ad2003c Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Thu, 5 Sep 2024 13:49:03 +0100 Subject: [PATCH] Merge pull request #2798 from rspec/fix-rails-main-for-solid-cache Fix rails main for solid cache --- Rakefile | 14 ++++++++++++-- example_app_generator/generate_stuff.rb | 6 +++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Rakefile b/Rakefile index da1a6fc94..35aac1bdf 100644 --- a/Rakefile +++ b/Rakefile @@ -105,6 +105,11 @@ namespace :smoke do in_example_app args.cmd.to_s end + desc "run rake routes in example app" + task :routes do + in_example_app "bin/rails routes" + end + desc "run RSPEC_OPTS environment variable in the example app for local dev" task :rspec do in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rspec #{ENV.fetch("RSPEC_OPTS")}" @@ -144,6 +149,11 @@ namespace :no_active_record do "no_active_record:smoke", ] + desc "run rake routes in example app" + task :routes do + in_example_app "bin/rails routes", app_dir: example_app_dir + end + desc "run RSPEC_OPTS environment variable in the example app for local dev" task :rspec do in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rspec #{ENV.fetch("RSPEC_OPTS")}", app_dir: example_app_dir @@ -165,7 +175,7 @@ namespace :no_active_record do sh "rm -f #{bindir}/rails" sh "bundle exec rails new #{example_app_dir} --no-rc --skip-active-record --skip-javascript --skip-bootsnap " \ "--skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --skip-spring " \ - "--skip-action-text --template=example_app_generator/generate_app.rb" + "--skip-action-text --skip-solid --template=example_app_generator/generate_app.rb" in_example_app(app_dir: example_app_dir) do sh "./ci_retry_bundle_install.sh 2>&1" @@ -188,7 +198,7 @@ namespace :no_active_record do desc "generate a bunch of stuff with generators" task :stuff do - in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb'", app_dir: example_app_dir + in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb' __RSPEC_NO_AR=true", app_dir: example_app_dir end end end diff --git a/example_app_generator/generate_stuff.rb b/example_app_generator/generate_stuff.rb index 57e2f705d..77d5a3ef9 100644 --- a/example_app_generator/generate_stuff.rb +++ b/example_app_generator/generate_stuff.rb @@ -57,10 +57,10 @@ def skip_active_record? end def self.environment_hooks - if defined?(ActiveRecord) - AR - else + if ENV['__RSPEC_NO_AR'] NoAR + else + AR end end end