Skip to content

Commit 8f9d7e4

Browse files
comandeo-mongop
authored andcommitted
MONGOID-5207 Test Ruby 3.1 on Evergreen (#5123)
1 parent 6f9c186 commit 8f9d7e4

File tree

3 files changed

+51
-25
lines changed

3 files changed

+51
-25
lines changed

.evergreen/config.yml

Lines changed: 45 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,10 @@ axes:
420420
display_name: ruby-3.0
421421
variables:
422422
RVM_RUBY: "ruby-3.0"
423+
- id: "ruby-3.1"
424+
display_name: ruby-3.1
425+
variables:
426+
RVM_RUBY: "ruby-3.1"
423427
- id: "ruby-head"
424428
display_name: ruby-head
425429
variables:
@@ -440,10 +444,15 @@ axes:
440444
- id: ubuntu-18.04
441445
display_name: "Ubuntu 18.04"
442446
run_on: ubuntu1804-small
443-
447+
- id: ubuntu-20.04
448+
display_name: "Ubuntu 20.04"
449+
run_on: ubuntu2004-small
444450
- id: rhel70
445451
display_name: "RHEL 7.0"
446452
run_on: rhel70-small
453+
- id: rhel80
454+
display_name: "RHEL 8.0"
455+
run_on: rhel80-small
447456
- id: "driver"
448457
display_name: Driver Version
449458
values:
@@ -531,15 +540,27 @@ axes:
531540
APP_TESTS: yes
532541

533542
buildvariants:
543+
- matrix_name: "ruby-3.1"
544+
matrix_spec:
545+
ruby: ["ruby-3.1"]
546+
driver: ["current"]
547+
topology: '*'
548+
mongodb-version: ['5.0']
549+
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
550+
run_on:
551+
- ubuntu2004-small
552+
tasks:
553+
- name: "test"
554+
534555
- matrix_name: "ruby-3.0"
535556
matrix_spec:
536557
ruby: ["ruby-3.0"]
537558
driver: ["current"]
538-
topology: '*'
559+
topology: ['replica-set']
539560
mongodb-version: ['5.0']
540-
display_name: "${ruby}, ${driver}, ${rails}, ${mongodb-version}, ${topology}"
561+
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
541562
run_on:
542-
- ubuntu1804-small
563+
- ubuntu2004-small
543564
tasks:
544565
- name: "test"
545566

@@ -571,19 +592,19 @@ buildvariants:
571592
matrix_spec:
572593
ruby: ["ruby-2.6"]
573594
driver: ["current"]
574-
topology: '*'
595+
topology: ['replica-set']
575596
mongodb-version: ['4.0']
576597
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
577598
run_on:
578-
- ubuntu1804-small
599+
- ubuntu1604-small
579600
tasks:
580601
- name: "test"
581602

582603
- matrix_name: "ruby-2.5"
583604
matrix_spec:
584605
ruby: ["ruby-2.5"]
585606
driver: ["current"]
586-
topology: '*'
607+
topology: ['replica-set']
587608
mongodb-version: ['3.6']
588609
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
589610
run_on:
@@ -594,12 +615,12 @@ buildvariants:
594615
- matrix_name: "driver-upcoming"
595616
matrix_spec:
596617
driver: [master, stable]
597-
ruby: ["ruby-3.0"]
618+
ruby: ["ruby-3.1"]
598619
mongodb-version: "5.0"
599620
topology: ['replica-set', 'sharded-cluster']
600621
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
601622
run_on:
602-
- rhel70-small
623+
- rhel80-small
603624
tasks:
604625
- name: "test"
605626

@@ -636,7 +657,7 @@ buildvariants:
636657
rails: ['6.0', '6.1']
637658
display_name: "${rails}, ${driver}, ${mongodb-version}"
638659
run_on:
639-
- rhel70-small
660+
- rhel80-small
640661
tasks:
641662
- name: "test"
642663

@@ -680,19 +701,20 @@ buildvariants:
680701
tasks:
681702
- name: "test"
682703

683-
- matrix_name: app-tests-ruby-3.0
684-
matrix_spec:
685-
ruby: ruby-3.0
686-
driver: ["current"]
687-
mongodb-version: '5.0'
688-
topology: standalone
689-
app-tests: yes
690-
rails: ['6.0', '6.1']
691-
display_name: "app tests ${driver}, ${ruby}, ${rails}"
692-
run_on:
693-
- ubuntu1804-small
694-
tasks:
695-
- name: "test"
704+
# https://jira.mongodb.org/browse/MONGOID-5216
705+
# - matrix_name: app-tests-ruby-3
706+
# matrix_spec:
707+
# ruby: ["ruby-3.0", "ruby-3.1"]
708+
# driver: ["current"]
709+
# mongodb-version: '5.0'
710+
# topology: standalone
711+
# app-tests: yes
712+
# rails: ['6.0', '6.1']
713+
# display_name: "app tests ${driver}, ${ruby}, ${rails}"
714+
# run_on:
715+
# - ubuntu2004-small
716+
# tasks:
717+
# - name: "test"
696718

697719
- matrix_name: app-tests-ruby-2.7
698720
matrix_spec:

lib/mongoid/config/environment.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ def load_yaml(path, environment = nil)
5151
if contents.empty?
5252
raise Mongoid::Errors::EmptyConfigFile.new(path)
5353
end
54-
data = YAML.load(ERB.new(contents).result)
54+
data = if RUBY_VERSION.start_with?("2.5")
55+
YAML.safe_load(ERB.new(contents).result, [Symbol], [], true)
56+
else
57+
YAML.safe_load(ERB.new(contents).result, permitted_classes: [Symbol], aliases: true)
58+
end
5559
unless data.is_a?(Hash)
5660
raise Mongoid::Errors::InvalidConfigFile.new(path)
5761
end

0 commit comments

Comments
 (0)