Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on JRuby #432

Closed
paneq opened this issue Aug 10, 2018 · 7 comments
Closed

Test on JRuby #432

paneq opened this issue Aug 10, 2018 · 7 comments

Comments

@paneq
Copy link
Member

paneq commented Aug 10, 2018

Add JRuby into .travis.yml matrix.

See:

@paneq
Copy link
Member Author

paneq commented Aug 10, 2018

Related #419

@paneq
Copy link
Member Author

paneq commented Aug 10, 2018

  • aggregate_root passes locally

@paneq
Copy link
Member Author

paneq commented Aug 10, 2018

  • bounded_context passes locally

@paneq
Copy link
Member Author

paneq commented Aug 10, 2018

  • 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
Copy link
Member Author

paneq commented Aug 10, 2018

  • 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
Copy link
Member Author

paneq commented Aug 10, 2018

  • rails_event_store-rspec passes locally

mostlyobvious added a commit that referenced this issue Nov 26, 2018
One can install (and successfully require) google-protobuf on Ruby 2.6
when specifying build platform:
protocolbuffers/protobuf#5161 (comment)

That however does not play well with Bundler. I did not manage to
override platform for single gem in bundle (being on OSX) nor to make
bundler use pre-built gem for different platform.

Apparently correctly pre-built gems will land in Feb:
protocolbuffers/protobuf#5161 (comment)

Similar kertuffle for JRuby:
protocolbuffers/protobuf#1594

I'd rather skip it altogether now and re-evaluate in the future.

[#431]
[#432]
[#461]
@mostlyobvious
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants