How we made our Rails test suite about 75 percent faster

13-May-2021 1381
One of my recent tasks has been to take the current test suite for a large-ish Rails app and speed it up as much as possible. This is the story of how I managed to do so without compromising the integrity of the tests.Our current suiteAt the time of starting, our test suite contained 1347 assertions, and took approximately 12 minutes to run on a 2018 Macbook Pro.The setup is as follows:The testing framework is MiniTest, which comes set up by default in new Rails applications.The database is populated using thoughtbot’s factory_bot.Feature tests are done using minitest-rails-capybara.Browser driver used for Capybara is geckodriver.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle