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

Projects
None yet
3 participants
@mennomenno

mennomenno commented Oct 16, 2015

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

This comment has been minimized.

Show comment
Hide comment
@grosser

grosser Oct 16, 2015

Owner

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 ...

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

This comment has been minimized.

Show comment
Hide comment
@Confusion

Confusion Dec 28, 2015

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

Confusion commented Dec 28, 2015

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

@grosser

This comment has been minimized.

Show comment
Hide comment
@grosser

grosser Jan 1, 2016

Owner

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)
.

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