RubyNepal / rorh

wiki for Ruby on Rails Himalayas (https://github.com/RubyNepal)
10 stars 1 forks source link

Fast Parallel Tests with Docker and Containers #24

Closed RohitRox closed 6 years ago

RohitRox commented 6 years ago

Docker is a new way to containerize services. The primary use so far has been for deploying services in a very thin container. I experimented with using it for Continuous Integration so that I could run our rails tests within a consistent environment and runs test in parallel in multiple containers, and then I realized that using docker provides excellent encapsulation to allow for parallelization of rails test suites.

zoras commented 6 years ago

@ashishbista previously wrote a nice blog post about this way back on 2016 http://ashishbista.com/2016/08/16/running-rails-rspec-tests-in-parallel-using-docker.html

RohitRox commented 6 years ago

@zoras Yeah, that's the gist of this issue request. Thanks for the link.

ashishbista commented 6 years ago

@zoras @RohitRox BTW, parallel testing will be a native thing in Rails 6. parallel_tests gem also does the same thing.

zoras commented 6 years ago

I've been using Knapsack gem to evenly split tests between two docker containers on CircleCI

screen shot 2018-04-12 at 9 19 50 pm
ashishbista commented 6 years ago

@zoras have you tried parallel_tests and knapsack together?

zoras commented 6 years ago

Not yet. But I don't think it matters much for CI server. It would be better approach to use parallel_tests in local machine and knapsack on CI.

zoras commented 6 years ago

Slides and other resources can be found here https://github.com/RubyNepal/rorh/wiki/RoR-Himalayan-Meetup-at-Kathmandu,-May-2018

See also: