Read more

Concurrent Tests

Lexy
August 25, 2010Software engineer at makandra GmbH

Install gem and plugin

sudo gem install parallel
script/plugin install git://github.com/grosser/parallel_tests.git

Adapt config/database.yml

test:
  database: xxx_test<%= ENV['TEST_ENV_NUMBER'] %>

Create test databases

script/dbconsole -p
CREATE DATABASE `xxx_test2`;
...

Generate RSpec files

script/generate rspec

(you'll probably only let it overwrite files in script/)

Prepare test databases

Illustration web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot

Now and after each migration:

rake parallel:prepare

Run tests

  • specs: rake parallel:spec
  • features: rake parallel:features

Multiple processes

If you want to test with multiple processes, you need to specify this when preparing the database and running the test, e.g:

rake parallel:prepare[4]
rake parallel:spec[4]

More than twice the amount of courses is probably not sensible, booting up rails takes its time, too.

Posted by Lexy to makandra dev (2010-08-25 15:16)