rails_event_store icon indicating copy to clipboard operation
rails_event_store copied to clipboard

Test on JRuby

Open paneq opened this issue 7 years ago • 6 comments

Add JRuby into .travis.yml matrix.

See:

  • https://docs.travis-ci.com/user/languages/ruby/
  • https://github.com/rvm/rvm/issues/4297#issuecomment-397908042

paneq avatar Aug 10 '18 12:08 paneq

Related #419

paneq avatar Aug 10 '18 12:08 paneq

  • [x] aggregate_root passes locally

paneq avatar Aug 10 '18 12:08 paneq

  • [x] bounded_context passes locally

paneq avatar Aug 10 '18 13:08 paneq

  • [ ] ruby_event_store

Works except for everything related to protobuf as the gem can't be compiled. We would need to disable loading these things on Jruby

rspec ./spec/mappers/protobuf_spec.rb:7 # RubyEventStore::Proto equality
rspec ./spec/mappers/protobuf_spec.rb:141 # RubyEventStore::Proto type
rspec ./spec/mappers/protobuf_spec.rb:77 # RubyEventStore::Proto equality - event_id must be the same
rspec ./spec/mappers/protobuf_spec.rb:52 # RubyEventStore::Proto equality - class must be the same
rspec ./spec/mappers/protobuf_spec.rb:101 # RubyEventStore::Proto equality - data must be the same
rspec ./spec/mappers/protobuf_spec.rb:125 # RubyEventStore::Proto yaml serialization
rspec ./spec/mappers/protobuf_spec.rb:31 # RubyEventStore::Proto equality - metadata does not need to be the same
rspec ./spec/mappers/protobuf_spec.rb:207 # RubyEventStore::Mappers::Protobuf #event_to_serialized_record returns proto serialized record
rspec ./spec/mappers/protobuf_spec.rb:216 # RubyEventStore::Mappers::Protobuf #serialized_record_to_event returns event instance
rspec ./spec/mappers/protobuf_spec.rb:225 # RubyEventStore::Mappers::Protobuf #serialized_record_to_event is using events class remapping
rspec ./spec/client_spec.rb:796 # RubyEventStore::Client can load serialized event using Protobuf mapper
rspec ./spec/client_spec.rb:319 # RubyEventStore::Client can handle protobuf event class instead of RubyEventStore::Event
rspec ./spec/link_by_metadata_spec.rb:31 # RubyEventStore::LinkByMetadata links to stream based on selected metadata (proto)

paneq avatar Aug 10 '18 13:08 paneq

  • [ ] rails_event_store_active_record

Almost passed with:

platform(:mri) do
  gem 'sqlite3', '1.3.13'
  gem 'pg', '0.21'
  gem 'mysql2', '0.4.10'
end

platform(:jruby) do
  gem 'activerecord-jdbcmysql-adapter', '51.1'
  gem 'activerecord-jdbcpostgresql-adapter', '51.1'
end

and protobuf disabled and Rails 5.1.6:

env "DATABASE_URL=postgresql://localhost/rails_event_store_active_record?pool=5" RAILS_VERSION=5.1.6 bundle exec rspec

so we could probably make it work.

errors:

  1) RailsEventStoreActiveRecord can be used without rails
     Failure/Error: process.start
     
     NameError:
       no constructor for arguments (org.jruby.ext.pathname.RubyPathname) on Java::JavaIo::File
         available overloads:
           (java.lang.String)
           (java.net.URI)
     # ./spec/without_rails_spec.rb:35:in `block in (root)'
     # ./spec/without_rails_spec.rb:16:in `block in (root)'
     # ./spec/support/mutant_timeout.rb:5:in `block in /Users/rupert/develop/rails_event_store/rails_event_store_active_record/spec/support/mutant_timeout.rb'

  2) RailsEventStoreActiveRecord::PgLinearizedEventRepository linearized by lock
     Failure/Error: exchanger.exchange!('unlocked', timeout)
     
     Concurrent::TimeoutError:
       Concurrent::TimeoutError
     # ./spec/pg_linearized_event_repository_spec.rb:39:in `block in RailsEventStoreActiveRecord'
     # ./spec/pg_linearized_event_repository_spec.rb:36:in `block in RailsEventStoreActiveRecord'

Finished in 52.31 seconds (files took 3.17 seconds to load)
147 examples, 2 failures, 3 pending

Failed examples:

rspec ./spec/without_rails_spec.rb:22 # RailsEventStoreActiveRecord can be used without rails
rspec ./spec/pg_linearized_event_repository_spec.rb:31 # RailsEventStoreActiveRecord::PgLinearizedEventRepository linearized by lock

paneq avatar Aug 10 '18 13:08 paneq

  • [ ] rails_event_store-rspec passes locally

paneq avatar Aug 10 '18 13:08 paneq

At the moment JRuby is compatible with Ruby 2.6, which we have dropped from supported matrix. I'd like to focus more on truffleruby which seems to have brighter future.

mostlyobvious avatar Nov 07 '22 12:11 mostlyobvious