Force RAILS_ENV to be "test" in rake tasks #776
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After #732, if you're using the SQL schema format,
parallel:prepare
now callsdb:purge db:structure:load
where it used to calldb:test:prepare
. The old task forced using the test environment, however the new tasks make no assumptions about the environment. Therefore, when combined with a Spring-ified rake binstub, where Spring defaults to the development environment, whenparallel:prepare
callsdb:purge db:structure:load
, they're running in the development environment against the development database, instead of in the test environment against the test database.Now the environment is forced to be "test" in all rake tasks regardless of the RAILS_ENV that might have been set, whether by Spring or the user. This has the side-effect of removing the ability to run the tasks in a test-like environment that's named something other than "test".
I believe this fixes #768.
Checklist
master
(if not - rebase it).code introduces user-observable changes.