Skip to content

Commit

Permalink
Fix JRuby compatibility + reduce test matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
jarthod committed Sep 12, 2024
1 parent 1bd631b commit 8382452
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ jobs:
matrix:
ruby_version: ['2.7', '3.0', '3.1', '3.2', '3.3', 'jruby']
gemfile:
- rails5-mongoid6
- rails5-mongoid7
- rails6-mongoid7
- rails7-mongoid8
# - rails7-mongoid9
include:
- ruby_version: head
- ruby_version: '2.4'
gemfile: rails5-mongoid6
- ruby_version: '2.5'
gemfile: rails5-mongoid7
- ruby_version: '3.3'
gemfile: rails-edge

env:
Expand Down
14 changes: 10 additions & 4 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@
# Test setup
MIGRATIONS_ROOT = 'test/migrations'

Mongoid.configure.load!("#{__dir__}/mongoid.yml", 'test')
Mongoid.configure do |config|
config.load_configuration(
clients: {
default: { hosts: ['localhost:27017'], database: 'mongoid_test' },
shard1: { hosts: ['localhost:27017'], database: 'mongoid_test_s1' }
},
options: { log_level: 2 } # JRuby 9.4.8 with Mongoid 8 has trouble finding the constants otherwise
)
end

require_relative 'models/survey_schema'

module TestMongoidRailsMigrations
Expand All @@ -19,9 +28,6 @@ class Application < Rails::Application; end

TestMongoidRailsMigrations::Application.load_tasks

# Mongo debug log
# Mongo::Logger.logger = Logger.new(STDOUT)

# Hide task output
class Mongoid::Migration
def self.puts _
Expand Down

0 comments on commit 8382452

Please sign in to comment.