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 suite fixes #1012

Merged
merged 9 commits into from
Dec 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,41 @@ env:
- RAILS_VERSION="~> 5.1.0"
- RAILS_VERSION="edge"
rvm:
- 2.1.10
- 2.2.7
- 2.3.4
- 2.4.1
- jruby-9.1.8.0
- 2.2.9
- 2.3.6
- 2.4.3
- 2.5.0
- jruby-9.1.15.0
- jruby-head
- rbx-2
- ruby-head
before_install:
- "gem install bundler"
jdk: oraclejdk8
matrix:
allow_failures:
- rvm: jruby-head
- rvm: rbx-2
- rvm: ruby-head
- env: RAILS_VERSION="edge"
- rvm: jruby-9.1.8.0
- rvm: jruby-9.1.15.0
env: RAILS_VERSION="~> 5.1.0"
fast_finish: true
# legacy testing
# things still run and we don't have a good reason to break it
# but we don't need to keep running the full matrix
include:
- rvm: 2.3.4
- rvm: 2.3.6
env: RAILS_VERSION="~> 3.0.0"
- rvm: 2.3.4
- rvm: 2.3.6
env: RAILS_VERSION="~> 3.1.0"
- rvm: 2.3.4
- rvm: 2.3.6
env: RAILS_VERSION="~> 3.2.0"
- rvm: 2.3.4
- rvm: 2.3.6
env: RAILS_VERSION="~> 4.0.0"
- rvm: 2.3.4
- rvm: 2.3.6
env: RAILS_VERSION="~> 4.1.0"
exclude:
- rvm: 2.1.10
env: RAILS_VERSION="~> 5.0.0"
- rvm: 2.1.10
env: RAILS_VERSION="~> 5.1.0"
- rvm: 2.1.10
env: RAILS_VERSION="~> 4.2.0"
exclude:
- rvm: 2.2.9
env: RAILS_VERSION="edge"
sudo: false
15 changes: 8 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
source 'https://rubygems.org'

rails_version = ENV['RAILS_VERSION'] || ''

gem 'rake'

platforms :ruby do
gem 'sqlite3'
end

platforms :jruby do
gem 'jruby-openssl'
if rails_version == 'edge' || rails_version.match(/5\.\d+\.\d+/)
gem 'activerecord-jdbcsqlite3-adapter',
:git => 'https://github.com/jruby/activerecord-jdbc-adapter.git',
:branch => 'rails-5'
if ENV['RAILS_VERSION'] == '~> 4.2.0'
gem 'activerecord-jdbcsqlite3-adapter', '< 50.0'
else
gem 'activerecord-jdbcsqlite3-adapter'
end
gem 'jruby-openssl'
gem 'mime-types', ['~> 2.6', '< 2.99']
if ENV['RAILS_VERSION'] == 'edge'
gem 'railties', :github => 'rails/rails'
else
gem 'railties', (ENV['RAILS_VERSION'] || ['>= 3.0', '< 5.2'])
end
end

platforms :rbx do
Expand Down
9 changes: 8 additions & 1 deletion lib/delayed/psych_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def visit_Psych_Nodes_Mapping(object) # rubocop:disable CyclomaticComplexity, Me
case object.tag
when %r{^!ruby/object}
result = super
if defined?(ActiveRecord::Base) && result.is_a?(ActiveRecord::Base)
if jruby_is_seriously_borked && result.is_a?(ActiveRecord::Base)
klass = result.class
id = result[klass.primary_key]
begin
Expand Down Expand Up @@ -78,6 +78,13 @@ def visit_Psych_Nodes_Mapping(object) # rubocop:disable CyclomaticComplexity, Me
end
end

# defined? is triggering something really messed up in
# jruby causing both the if AND else clauses to execute,
# however if the check is run here, everything is fine
def jruby_is_seriously_borked
defined?(ActiveRecord::Base)
end

def resolve_class(klass_name)
return nil if !klass_name || klass_name.empty?
klass_name.constantize
Expand Down