ioquatix / turbo_test

MIT License
102 stars 6 forks source link

Installation Steps #6

Open bmulholland opened 3 years ago

bmulholland commented 3 years ago

It wasn't obvious how to install & use this, so recording my steps here:

  1. Add to Gemfile for test and development groups: gem "turbo_test"
  2. Add test env number to database.yml, just like with parallel_tests: https://github.com/grosser/parallel_tests#add-to-configdatabaseyml
  3. Set that env for each worker by creating a new file turbo_test.rb at the project root, with (via https://github.com/ioquatix/turbo_test/issues/4#issuecomment-782938194):
    
    ENV["RAILS_ENV"] = "test"

worker do |index| index = index + 1 ENV['TEST_ENV_NUMBER'] = index == 1 ? "" : index.to_s

create a database for each worker

system("bin/rails", "db:drop", "db:create", "db:migrate") end


4. Run with `bundle exec turbo_test`
ioquatix commented 3 years ago

Yes, that looks acceptable to me. Did it work as expected?

bmulholland commented 3 years ago

Not yet, because databases did not exist. See https://github.com/ioquatix/turbo_test/discussions/8 for steps necessary before turbo_test can be run.