Dry::Schema test suite failing under ruby 3.2.0 RC-1

I was running some ideas for Dry::Schema when I notice the test suite having errors I never saw in previous versions (2.7 ~ 3.1.x).

Not sure if is something someone is working actively now or even if this need to fixed now. IMO this need to be investigate it (I volunteer myself) because colleagues testing Ruby 3.2 will be reporting the same soon enough - Ruby 3.2 will probably be released next week (Dec 24th, 2022) as the ruby dev team usually does.

This is my local

checking on GitHub it looks like is the same on GitHub actions:

this might be related: YJIT: Fix `obj.send(:call)` by XrXr · Pull Request #6943 · ruby/ruby · GitHub

We’re aware of this, so far nobody had the time to work on a fix (if it’s needed). PRs are most welcome of course.

I’m seeing another error caused by this issue in rspec-mocks. There’s an open PR to fix this.

The path is being generated without an array index, so that accounts: [{user: {date: nil}}] is being used with #<Dry::Schema::Path keys=[:accounts, :user]> while that should be [:accounts, 0, :user].

The construction of that Path is hard to locate, though, so I’m not certain what the root cause is.

@alassek I’m not sure what this is referring to?

I reran it on 3.2.0 final and this didn’t come up :man_shrugging: So I guess just nevermind.

I am seeing test failures from some stubs complaining that they received arguments hashes when they expected keyword arguments… I’m guessing that has to do with the rspec-mocks argument forwarding issue.

I can confirm the issue should be gone once rspec-mocks is updated to 3.12.2 which was published yesterday (2023-01-07). No changes needed since ruby 3.2.0 (final) fixes the initial issue and rspec-mocks fixed their issues with ruby 3.2.x on version rspec-mocks v3.12.2

root@9f517a712e21:/src/ ruby --version
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-linux]
root@9f517a712e21:/src/ rspec --version
RSpec 3.12
  - rspec-core 3.12.0
  - rspec-expectations 3.12.2
  - rspec-mocks 3.12.0
  - rspec-support 3.12.0
root@9f517a712e21:/src/ rspec --only-failures | grep 'Failed examples' -a3
Finished in 0.02915 seconds (files took 0.22633 seconds to load)
2 examples, 2 failures

Failed examples:

rspec ./spec/unit/dry/schema/messages/template_spec.rb:45 # Dry::Schema::Messages::Template#call delegates to the message backend
rspec ./spec/unit/dry/schema/messages/template_spec.rb:20 # Dry::Schema::Messages::Template#data delegates to the message backend
root@9f517a712e21:/src/ bundle update --quiet
root@9f517a712e21:/src/ rspec --version
RSpec 3.12
  - rspec-core 3.12.0
  - rspec-expectations 3.12.2
  - rspec-mocks 3.12.2
  - rspec-support 3.12.0
root@9f517a712e21:/src# rspec --only-failures | grep 'Failed examples' -a3
root@9f517a712e21:/src/ # No error