-
Notifications
You must be signed in to change notification settings - Fork 80
Description
Built-in parallel testing was recently merged into Rails master and will land with Rails 6: rails/rails#31900
The PR description and the Parallel Testing Guide cover the feature pretty well from a user's point of view.
TL;DR: ActiveSupport provides some hooks in test mode that ActiveRecord now uses to create and auto-migrate n databases, creates n forks (or threads) and splits the tests between them, then drops the databases.
The implementation for ActiveRecord is really quite small at <40 LoC.
As a devout Sequel user, I'd love to see support for this feature land in this project in time for the release of Rails 6. I'm hoping to have some time of my own to work on this over the next couple months, but I of course won't be upset if somebody beats me to it 😄
One consideration that is relevant for me. It appears the ActiveRecord PR does the suite of migrations on each test database, which might take awhile. I personally use the db:test:prepare task to load my schema directly instead of running through all my migrations on the test DB. I'm assuming this would be quite a bit faster than doing a migrate for most folks? Don't know if both methods are commonly used with sequel-rails but I definitely care more about the db:load variant.