-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Watch for YAML file changes for fixtures #557
Conversation
17812c5
to
ff2cdb7
Compare
@vinistock I'm unsure how we'd go about writing a test for this, any thoughts? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what we could test. There's not a ton of logic, it's essentially just sending configuration to the client.
ae0e434
to
08eaf66
Compare
@@ -3,6 +3,7 @@ | |||
|
|||
require "json" | |||
require "open3" | |||
require "rails/test_help" # to determine the fixture_paths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight concern that this might alter the behaviour in some way.
https://github.com/rails/rails/blob/main/railties/lib/rails/test_help.rb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we require a smaller subset of things? Do we need anything beyond active_support/test_case
? Or can we match the logic in Rails and avoid requiring anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use only the minimum parts.
7ed3715
to
f7643cd
Compare
ActiveSupport.on_load(:active_support_test_case) do | ||
include ActiveRecord::TestFixtures | ||
|
||
fixture_paths << "#{Rails.root}/test/fixtures/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where do people normally configure their fixture_paths
?
I just realized that, if people do it in test/test_helper.rb
or in environments/test.rb
, we are probably going to miss it anyway.
I may have set you on the wrong path here, I'm not sure we can accurately detect which fixture paths were configured.
Also, the server.rb
file is loaded after the Rails app is fully initialized, so any initializers would have already run.
140761e
to
7f90b1d
Compare
7f90b1d
to
e712ffd
Compare
This is to support Shopify/tapioca#2150 but will probably be useful for other upcoming features.