jruby / activerecord-jdbc-adapter

JRuby's ActiveRecord adapter using JDBC.
BSD 2-Clause "Simplified" License
462 stars 385 forks source link

Fix some activerecord spec failures for Rails 7 support #1127

Closed rdubya closed 1 year ago

rdubya commented 1 year ago

This adds support for the query tagging feature and updates the sqlite adapter to match how the typemap is created in ActiveRecord.

rdubya commented 1 year ago

It looks like a bunch of the ActiveRecord tests fail because the arguments are being recognized as a hash instead of keyword arguments. One example is:

TransactionalFixturesOnConnectionNotification#test_notification_established_transactions_are_rolled_back:
[1000](https://github.com/jruby/activerecord-jdbc-adapter/actions/runs/4343668791/jobs/7586001910#step:5:1001)
ArgumentError: mocked method :call expects 2 arguments, got ["book"]
enebo commented 1 year ago

@rdubya The transform_query also fixed about 10-12 postgresql errors too.

The kwarg errors you mention could be a kwargs error (and they definitely are if you can see there is a kwargs hash as the extra element) but I do not see where any of that flows through our code and as far as I know our only kwargs issue would be if we have a native(Java) method which is getting called in there (we need keywords=true annotations). I do hope that is true since that is a nice chunk of problem which wold dissolve when corrected.

Also thanks for the help. If you have time stop by matrix/element.io channel so I can ask you about oids in postgresql :)

enebo commented 1 year ago

@rdubya I see a failure with kwargs and mocking in minitest's unit tests. This likely is the issue for us.