On Friday, January 31, 2020 at 9:41:17 AM UTC-8, Bj Lawson wrote: > > Hi Jeremy -- we are in the same situation here, updating a mature Rails > 4.2 app to Rails 5. It looks like one of the best things we can do to > improve the performance of our tests and builds is to take advantage of > Rails 5's new System Tests which use transactional fixtures... and our web > app is a Sequel / AR hybrid where we use Sequel for our SELECTs but are > still using AR for INSERT/UPDATEs. So of course the Sequel connection > cannot see the data within the AR connection's transaction. > > Our build / test time has increased by 50% moving from the old > capybara-webkit driver to a modern headless browser configuration... and > we're highly motivated to find a way to no longer need database_cleaner for > our functional / system tests. > > Are you aware of any documentation that would allow us to: > > 1) Limit Sequel to a single connection during testing to ensure that the > test data is visible within the scope of the test's transaction? >
Limiting to a single connection is easy with Sequel. You can set the :max_connections => 1 Database option. > 2) Have ActiveRecord use that same connection during testing per your > comment below? > That requires hacking ActiveRecord's connection pool, and I have no idea how to do it, and I'm guessing how to do it depends on the version of Rails in use. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sequel-talk/95b195cc-94c7-411b-8354-dc0f6c0ea88f%40googlegroups.com.
