RailsEventStore / rails_event_store

A Ruby implementation of an Event Store based on Active Record
http://railseventstore.org
MIT License
1.42k stars 121 forks source link

Test on JRuby #432

Closed paneq closed 1 year ago

paneq commented 6 years ago

Add JRuby into .travis.yml matrix.

See:

paneq commented 6 years ago

Related #419

paneq commented 6 years ago
paneq commented 6 years ago
paneq commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago
mostlyobvious commented 1 year ago

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.