serpapi / turbo_tests

Run RSpec tests on multiple cores. Like parallel_tests but with incremental summarized output. Originally extracted from the Discourse and Rubygems source code.
https://rubygems.org/gems/turbo_tests
MIT License
173 stars 25 forks source link

Automatically create a database similar to Rails #18

Open ilyazub opened 2 years ago

ilyazub commented 2 years ago

It'd be good to automatically set up a database similar to Rails. Rails docs.

In Rails, ActiveRecord::Tasks::DatabaseTasks.reconstruct_from_schema is called inside the ActiveSupport::Testing::Parallelization#after_fork_hook. Ref.

TODO


Originally posted by @pirj in https://github.com/rspec/rspec-rails/issues/2104#issuecomment-1022567077:

What was missing (and what Rails provides with its default testing framework):

Active Record automatically handles creating a database

Without createdb myproject2 etc it didn't work. I've seen rails db:test:prepare, but db:create wasn't apparently called.