Skip to content

Commit a74f039

Browse files
committed
Skip Pro validation for example app RSpec tests
Example apps are generated with the base gem but run in a monorepo environment where the Pro gem is available. When RSpec loads the Rails environment, the version checker detects Pro gem is available but example app only has 'react-on-rails' npm package, causing validation to fail. Solution: - Add REACT_ON_RAILS_SKIP_VALIDATION=true to run_tests_in() call for example apps in run_rspec.rake - This complements the previous fix for generate_packs in shakapacker_examples.rake This is safe because: - Example apps are for testing the generator, not production use - The validation is still enforced in normal app initialization - It's consistent with skipping validation during generation Fixes RSpec test failures in Phase 6 monorepo examples CI.
1 parent b7ec67b commit a74f039

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rakelib/run_rspec.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ namespace :run_rspec do
8181
puts "Creating #{example_type.rspec_task_name} task"
8282
desc "Runs RSpec for #{example_type.name_pretty} only"
8383
task example_type.rspec_task_name_short => example_type.gen_task_name do
84-
run_tests_in(File.join(examples_dir, example_type.name)) # have to use relative path
84+
# Skip validation since example apps only have base gem but Pro may be available in parent bundle
85+
run_tests_in(File.join(examples_dir, example_type.name), env_vars: "REACT_ON_RAILS_SKIP_VALIDATION=true")
8586
end
8687
end
8788

0 commit comments

Comments
 (0)