rails_event_store
rails_event_store copied to clipboard
Test on TruffleRuby
Add TruffleRuby into .travis.yml
matrix.
See:
- https://docs.travis-ci.com/user/languages/ruby/
- https://github.com/rvm/rvm/issues/4297#issuecomment-397908042
For now it's probably not yet possible to successfully run it, because of https://github.com/oracle/truffleruby/issues/1400 . But someone can try :)
I believe you can set expected fail on Travis in regard to some matrix configurations or don't test c-ext matrix branches at all.
https://docs.travis-ci.com/user/customizing-the-build/#rows-that-are-allowed-to-fail it is
https://www.reddit.com/r/ruby/comments/9clma3/truffle_ruby_100rc6_supports_pg_and_mysql_drivers/
https://github.com/oracle/truffleruby/issues/62
Let's wait till it's travis-rim-supported out of the box.
https://github.com/oracle/truffleruby/issues/62#issuecomment-407322864
Current PR: https://github.com/RailsEventStore/rails_event_store/pull/505
Aside to running tests on CI, I've scoped down the test run to ruby_event_store
and it fails on:
rspec ./spec/batch_enumerator_spec.rb:22 # RubyEventStore::BatchEnumerator
rspec ./spec/batch_enumerator_spec.rb:50 # RubyEventStore::BatchEnumerator should receive call(kind of Integer, kind of Integer) 1 time
rspec ./spec/batch_enumerator_spec.rb:30 # RubyEventStore::BatchEnumerator should yield successive args([1, 2, 3, 4, 5, 6, 7, 8,
where the code involved is:
Failure/Error: (0...total_limit).step(batch_size) do |batch_offset|
ArgumentError:
Infinite or NaN
irb(main):003:0> (0...Float::INFINITY).step(1).next
ArgumentError: Infinite or NaN
To be revisited after oracle/truffleruby#1503 and #422 (comment) are solved.
Let's check this in what's left from 2020
@pawelpacana any update? :)
@LifeIsStrange one minor issue in ruby_event_store
gem (in test code) that would require reporting in TruffleRuby tracker: an instance of what is Integer on MRI is a Float under Truffleruby.
Failures:
1) RubyEventStore::BatchEnumerator is expected to receive call(kind of Integer, kind of Integer) 1 time
Failure/Error: result = reader.call(batch_offset, batch_limit)
#<Double :reader> received :call with unexpected arguments
expected: (kind of Integer, kind of Integer)
got: (0.0, 100)
# ./lib/ruby_event_store/batch_enumerator.rb:16:in `block in each'
# <internal:core> core/numeric.rb:131:in `step'
# ./lib/ruby_event_store/batch_enumerator.rb:14:in `each'
# <internal:core> core/enumerator.rb:103:in `each_with_block'
# <internal:core> core/enumerator.rb:94:in `each'
# <internal:core> core/enumerable.rb:287:in `to_a'
# ./lib/ruby_event_store/batch_enumerator.rb:28:in `to_a'
# ./spec/batch_enumerator_spec.rb:52:in `block (2 levels) in <module:RubyEventStore>'
# <internal:core> core/kernel.rb:400:in `load'
# <internal:core> core/kernel.rb:400:in `load'
# <internal:core> core/kernel.rb:400:in `load'
# <internal:core> core/kernel.rb:400:in `load'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli/exec.rb:63:in `kernel_load'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli/exec.rb:28:in `run'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli.rb:476:in `exec'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli.rb:30:in `dispatch'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/cli.rb:24:in `start'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/gems/gems/bundler-2.1.4/libexec/bundle:46:in `block in <top (required)>'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/mri/bundler/friendly_errors.rb:123:in `with_friendly_errors'
# /Users/pawelpacana/.rubies/truffleruby-21.0.0/lib/gems/gems/bundler-2.1.4/libexec/bundle:34:in `<top (required)>'
# <internal:core> core/kernel.rb:400:in `load'
# <internal:core> core/kernel.rb:400:in `load'
Finished in 19.62 seconds (files took 2.45 seconds to load)
713 examples, 1 failure, 7 pending
Failed examples:
rspec ./spec/batch_enumerator_spec.rb:50 # RubyEventStore::BatchEnumerator is expected to receive call(kind of Integer, kind of Integer) 1 time
Do you think it is something you could help us with? The way I see it is:
- reducing the code to minial amount showing the disparity of Truffleruby with MRI
- reporting this similarly to https://github.com/oracle/truffleruby/issues/1503
@pawelpacana hi, thanks for the update! Sorry I can't help with this task, I'm just a nerd interested in Truffleruby support for Rails and how it would affect performance, I don't even know the Ruby language yet ^^
Just seeing this, I think it would be fine to basically file https://github.com/RailsEventStore/rails_event_store/issues/419#issuecomment-779402997 as a TruffleRuby issue, as long as it's relatively easy to reproduce. We don't necessarily need a minimal reproduction, although of course it's always helpful.
Already testing.