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?
2) Have ActiveRecord use that same connection during testing per your 
comment below?

Thanks in advance as we get back to googling...

BJ

On Wednesday, April 24, 2019 at 10:56:30 AM UTC-4, Jeremy Evans wrote:
>
> On Wednesday, April 24, 2019 at 7:51:59 AM UTC-7, My Nguyen wrote:
>>
>> Hi Jeremy, 
>> We are migrating away from ActiveRecord in our Rails app, and we are 
>> running into issues with transactional fixture in our tests. We think the 
>> problem can be solved by sharing the same connection between Sequel and 
>> ActiveRecord in test environment ( similar to the Capybara hack )
>>
>> Is there a way I could initialize a Sequel::Postgres::Database object 
>> from a PG::Connection instead of a connection hash?
>>
>
> No.  Some people in the past have had success trying to make ActiveRecord 
> use connection's from Sequel's connection pool, but it is not possible to 
> go the other way, as Sequel uses a subclass of PG::Connection.
>
> 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/132ef0ed-95ec-43f7-8c62-8ae7d75aae6a%40googlegroups.com.

Reply via email to