Skip to content

MONGOID-5207 Test Ruby 3.1 on Evergreen #5123

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

Merged
merged 7 commits into from
Jan 7, 2022
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
68 changes: 45 additions & 23 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ axes:
display_name: ruby-3.0
variables:
RVM_RUBY: "ruby-3.0"
- id: "ruby-3.1"
display_name: ruby-3.1
variables:
RVM_RUBY: "ruby-3.1"
- id: "ruby-head"
display_name: ruby-head
variables:
Expand All @@ -440,10 +444,15 @@ axes:
- id: ubuntu-18.04
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-small

- id: ubuntu-20.04
display_name: "Ubuntu 20.04"
run_on: ubuntu2004-small
- id: rhel70
display_name: "RHEL 7.0"
run_on: rhel70-small
- id: rhel80
display_name: "RHEL 8.0"
run_on: rhel80-small
- id: "driver"
display_name: Driver Version
values:
Expand Down Expand Up @@ -531,15 +540,27 @@ axes:
APP_TESTS: yes

buildvariants:
- matrix_name: "ruby-3.1"
matrix_spec:
ruby: ["ruby-3.1"]
driver: ["current"]
topology: '*'
mongodb-version: ['5.0']
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
run_on:
- ubuntu2004-small
tasks:
- name: "test"

- matrix_name: "ruby-3.0"
matrix_spec:
ruby: ["ruby-3.0"]
driver: ["current"]
topology: '*'
topology: ['replica-set']
mongodb-version: ['5.0']
display_name: "${ruby}, ${driver}, ${rails}, ${mongodb-version}, ${topology}"
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
run_on:
- ubuntu1804-small
- ubuntu2004-small
tasks:
- name: "test"

Expand Down Expand Up @@ -571,19 +592,19 @@ buildvariants:
matrix_spec:
ruby: ["ruby-2.6"]
driver: ["current"]
topology: '*'
topology: ['replica-set']
mongodb-version: ['4.0']
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
run_on:
- ubuntu1804-small
- ubuntu1604-small
tasks:
- name: "test"

- matrix_name: "ruby-2.5"
matrix_spec:
ruby: ["ruby-2.5"]
driver: ["current"]
topology: '*'
topology: ['replica-set']
mongodb-version: ['3.6']
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
run_on:
Expand All @@ -594,12 +615,12 @@ buildvariants:
- matrix_name: "driver-upcoming"
matrix_spec:
driver: [master, stable]
ruby: ["ruby-3.0"]
ruby: ["ruby-3.1"]
mongodb-version: "5.0"
topology: ['replica-set', 'sharded-cluster']
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
run_on:
- rhel70-small
- rhel80-small
tasks:
- name: "test"

Expand Down Expand Up @@ -636,7 +657,7 @@ buildvariants:
rails: ['6.0', '6.1']
display_name: "${rails}, ${driver}, ${mongodb-version}"
run_on:
- rhel70-small
- rhel80-small
tasks:
- name: "test"

Expand Down Expand Up @@ -680,19 +701,20 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: app-tests-ruby-3.0
matrix_spec:
ruby: ruby-3.0
driver: ["current"]
mongodb-version: '5.0'
topology: standalone
app-tests: yes
rails: ['6.0', '6.1']
display_name: "app tests ${driver}, ${ruby}, ${rails}"
run_on:
- ubuntu1804-small
tasks:
- name: "test"
# https://jira.mongodb.org/browse/MONGOID-5216
# - matrix_name: app-tests-ruby-3
# matrix_spec:
# ruby: ["ruby-3.0", "ruby-3.1"]
# driver: ["current"]
# mongodb-version: '5.0'
# topology: standalone
# app-tests: yes
# rails: ['6.0', '6.1']
# display_name: "app tests ${driver}, ${ruby}, ${rails}"
# run_on:
# - ubuntu2004-small
# tasks:
# - name: "test"

- matrix_name: app-tests-ruby-2.7
matrix_spec:
Expand Down
6 changes: 5 additions & 1 deletion lib/mongoid/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ def load_yaml(path, environment = nil)
if contents.empty?
raise Mongoid::Errors::EmptyConfigFile.new(path)
end
data = YAML.load(ERB.new(contents).result)
data = if RUBY_VERSION.start_with?("2.5")
YAML.safe_load(ERB.new(contents).result, [Symbol], [], true)
else
YAML.safe_load(ERB.new(contents).result, permitted_classes: [Symbol], aliases: true)
end
unless data.is_a?(Hash)
raise Mongoid::Errors::InvalidConfigFile.new(path)
end
Expand Down
2 changes: 1 addition & 1 deletion spec/shared