grosser / parallel_tests

Ruby: 2 CPUs = 2x Testing Speed for RSpec, Test::Unit and Cucumber
3.38k stars 494 forks source link

Support for multitenancy in Postgres #246

Open amejiarosario opened 11 years ago

amejiarosario commented 11 years ago

This is a gem! I have 8 cores and tests that used to take up to 4 min. runs in around 30 secs. However, I noticed some of them fails when I run it with parallel tests and that's because I'm using the apartment gem to create multiple schemas on postgres. Any work around? Ideas?

grosser commented 11 years ago

Putting ENV["TEST_ENV_NUMBER"] into each databases name could help reduce the collisions

pr0d1r2 commented 9 years ago

@amejiarosario I have made it work by creating separate schema for each tenant before suite, see: https://github.com/influitive/apartment/wiki/Testing-Your-Application

Company.create!(name: 'Influitive Corp.', subdomain: "app#{ENV["TEST_ENV_NUMBER"]}")

So clearly it is not parallel_tests issue but feature ;)