-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Define an empty test:prepare
task
#2610
Comments
It would mean that any future gems would also need to check for additional tasks and it seems like Certainly my conversations with the rails core team have resulted in the suggestion that the placeholder task is done in From what I can see, it wouldn't have any negative impact by defining it. |
We're happy to do this but seems like a workaround for a proper API rails should declare. |
My main concern is that Rails would introduce an idempotency check for their non-empty definition like "define test:prepare if it isn't defined yet", and our empty definition would load earlier and would prevent the Rails one to be defined.
Can you please refer to them? |
I will absolutely do that. Just one point that I'm confused about in your last comment is that you refer to their non-empty definition, but the definition is exactly that in rails core - an empty placeholder. Apologies if I've missed something here? |
In my attempt of a thought experiment, I assumed that even though it is empty now, this may change in the future. |
Further investigation into this would require I'm more inclined to agree that this should be a task that is defined at the base Rails level at which point it is always enhanced and included right at the top of any Gemfile by convention. I'm hoping that this finds agreement with the Rails Core team. |
How does it work when a Tailwind rake task runs, the empty |
Running As a result if the Rails application includes the test_unit railtie, then the Therefore, if you run |
Gems like
tailwindcss-rails
andjsbundling-rails
run their respective build tasks by hooking in totest:prepare
which is defined as an empty task in the Test Unit railtie.It would be helpful to define the same empty task if it's not already defined to allow those and other gems to perform their build tasks ahead of testing, rather than forcing the user to precompile assets. If the user is forced to precompile ahead of tests, then the suite needs to clobber them after running, otherwise the user becomes confused when future changes have no impact because the local development Rails app is loading the compiled assets rather than those in
app/assets/build
.Would you be happy to accept a PR that adds a similar empty task as that defined here?
The text was updated successfully, but these errors were encountered: