Skip to content
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

Force RAILS_ENV to be "test" in rake tasks #776

Merged
merged 1 commit into from Aug 28, 2020

Commits on Aug 28, 2020

  1. Force RAILS_ENV to be "test" in rake tasks

    After grosser#732, if you're using the SQL schema format, `parallel:prepare`
    now calls `db:purge db:structure:load` where it used to call
    `db: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, when `parallel:prepare` calls
    `db: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 grosser#768.
    cgunther committed Aug 28, 2020
    Copy the full SHA
    b72cb4c View commit details
    Browse the repository at this point in the history