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

Parallel:prepare task uses deprecated db:test:prepare for sql-based schemas #455

Open
mennomenno opened this issue Oct 16, 2015 · 3 comments

Comments

@mennomenno
Copy link

The parallel:prepare task invokes db:test:prepare when database schema has been dumped in sql. See lib/parallel_tests/tasks.rb:93

# there is no separate dump / load for schema_format :sql -> do it safe and slow
args = args.to_hash.merge(:non_parallel => true) # normal merge returns nil
taskname = Rake::Task.task_defined?('db:test:prepare') ? 'db:test:prepare' : 'app:db:test:prepare'
ParallelTests::Tasks.run_in_parallel("rake #{taskname}", args)

In Rails 4 this triggers a deprecation warning:

WARNING: db:test:prepare is deprecated. The Rails test helper now maintains your test schema automatically, see the release notes for details.

For details see rails/rails#13528

@grosser
Copy link
Owner

grosser commented Oct 16, 2015

Yeah these warnings are annoying, a PR to silence them (silence_warnings{ xxx } since I don't think it got dropped in rails 5) would be great.

I found the automatic migrator to not be very reliable, when messing with migrations / schema you can end up in bad states. Prepare is my 'get me back to safety' hatch and a nice tool to get a level playing field when debugging crazy bugs.

The automated migrator should be working on separate test databases, so there might be no need to call prepare as part of the default setup, but not sure ...

@Confusion
Copy link

Could we replace the db:test:prepare by a db:reset RAILS_ENV=test?

@grosser
Copy link
Owner

grosser commented Jan 1, 2016

possible ... need to dig through the sources a bit to see if they are
similar ... ideally stay as close to what rails does as possible to avoid
weird edge-cases :)

On Mon, Dec 28, 2015 at 4:06 PM, Ivo Wever notifications@github.com wrote:

Could we replace the db:test:prepare by a db:reset RAILS_ENV=test?


Reply to this email directly or view it on GitHub
#455 (comment)
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants