Running a full RSpec test suite locally can take hours, but parallel test execution can dramatically cut that time. Using the turbo_tests gem (built on parallel_tests), you can split your test suite across multiple processes, each with its own isolated database via the TEST_ENV_NUMBER environment variable. The post covers configuring worker-specific databases in database.yml, isolating Redis cache and background job state per worker using namespaces or separate Redis databases, and setting up all worker databases with a custom shell script that loops over available CPU cores. The result on one project was a drop from nearly 2 hours to under 5 minutes.

5m read timeFrom fastruby.io
Post cover image
Table of contents
Setting up parallel testsIsolating Redis and Cache ResourcesSetting up the databasesConclusion
314 Impressions1 Comment