Skip to content

Support parallel testing (coming in Rails 6) #159

@bgentry

Description

@bgentry

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions