Skip to content

Commit

Permalink
MONGOID-5810 make sure we don't leak internal state via as_document (…
Browse files Browse the repository at this point in the history
…backport to 8.0-stable) (#5903)

* make sure we don't leak internal state via as_document (#5899)

* start trying to fix the broken 8.0-stable test environment

* more test reconfiguring

* fiddling with configuration

* fix a couple more failing tests, maybe
  • Loading branch information
jamis authored Dec 19, 2024
1 parent 3e04142 commit cdc98d5
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 76 deletions.
103 changes: 70 additions & 33 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ functions:
git submodule update --init --recursive
if [ ! -d .mod ]; then
mkdir -p .mod
cd .mod
git clone https://github.com/mongodb-labs/drivers-evergreen-tools
fi
"fetch egos":
- command: shell.exec
params:
Expand All @@ -61,7 +67,7 @@ functions:
CURRENT_VERSION=latest
fi
export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
export DRIVERS_TOOLS="$(pwd)/.mod/drivers-evergreen-tools"
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
Expand Down Expand Up @@ -95,6 +101,15 @@ functions:
export SSL=${SSL}
export APP_TESTS=${APP_TESTS}
export DOCKER_DISTRO=${DOCKER_DISTRO}
export MONGODB_URI="${MONGODB_URI}"
export RVM_RUBY="${RVM_RUBY}"
export RAILS="${RAILS}"
export DRIVER="${DRIVER}"
export I18N="${I18N}"
export TEST_I18N_FALLBACKS="${TEST_I18N_FALLBACKS}"
export FLE="${FLE}"
export TOOLCHAIN_OVERRIDE="${TOOLCHAIN_OVERRIDE}"
EOT
# See what we've done
cat expansion.yml
Expand Down Expand Up @@ -267,6 +282,16 @@ functions:
file: ./src/tmp/rspec.xml

"run tests":
- command: shell.exec
type: test
params:
shell: bash
working_dir: "src"
script: |
${PREPARE_SHELL}
.evergreen/run-tests.sh
"run tests in docker":
- command: shell.exec
type: test
params:
Expand Down Expand Up @@ -442,19 +467,19 @@ axes:
values:
- id: ubuntu-22.04
display_name: "Ubuntu 22.04"
run_on: ubuntu2204-small
- id: ubuntu-20.04
display_name: "Ubuntu 20.04"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: ubuntu2204
- id: ubuntu-18.04
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-small
- id: debian11
display_name: "Debian 11"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: debian11
run_on: debian11-small
- id: rhel80
display_name: "RHEL 8.0"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: rhel80
run_on: rhel80-small

- id: "driver"
display_name: Driver Version
Expand Down Expand Up @@ -558,14 +583,33 @@ axes:
variables:
APP_TESTS: yes

- id: toolchain
display_name: Toolchain Version
values:
- id: 2023-05-11
display_name: 2023-05-11
variables:
TOOLCHAIN_OVERRIDE: e8c60866f54bed7e336a37df3a97d6ae1b971b7d
- id: 2023-11-02
display_name: 2023-11-02
variables:
TOOLCHAIN_OVERRIDE: ded7ea845b08cf96f11a747d9540ba3199580dea
- id: 2024-08-07
display_name: 2024-08-07
variables:
TOOLCHAIN_OVERRIDE: c950fe1e85fd7d5e4ea69cc2afff456825583716
- id: 2024-09-06
display_name: 2024-09-06
variables:
TOOLCHAIN_OVERRIDE: deefab59d8f539bdd4a0154505f1e7d39a0857d0
buildvariants:
- matrix_name: "mongodb-latest"
matrix_spec:
ruby: ["ruby-3.1"]
driver: ["current"]
topology: '*'
mongodb-version: ['latest']
os: debian11
os: ubuntu-22.04
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"
Expand All @@ -581,24 +625,13 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: "ruby-3.0"
matrix_spec:
ruby: ["ruby-3.0"]
driver: ["current"]
topology: ['replica-set']
mongodb-version: ['5.0']
os: rhel80
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"

- matrix_name: "jruby"
matrix_spec:
jruby: ["jruby-9.3"]
driver: ["current"]
topology: ['replica-set', 'sharded-cluster']
mongodb-version: '5.0'
os: rhel80
os: ubuntu-18.04
display_name: "${jruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"
Expand Down Expand Up @@ -676,31 +709,33 @@ buildvariants:
ruby: ["ruby-2.7"]
mongodb-version: "5.0"
topology: "standalone"
os: rhel80
os: ubuntu-20.04
toolchain: 2024-09-06
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"

- matrix_name: "bson-master"
matrix_spec:
driver: [bson-master]
ruby: ["ruby-3.0"]
ruby: ["ruby-3.1"]
mongodb-version: "5.0"
topology: "standalone"
os: rhel80
os: ubuntu-20.04
toolchain: 2024-09-06
display_name: "${ruby}, ${driver}, ${mongodb-version}, ${topology}"
tasks:
- name: "test"


- matrix_name: "rails-6"
matrix_spec:
ruby: ["ruby-3.0"]
ruby: ["ruby-3.1"]
driver: ["current"]
mongodb-version: "6.0"
topology: "standalone"
rails: ['6.0', '6.1']
os: rhel80
os: ubuntu-22.04
display_name: "${rails}, ${driver}, ${mongodb-version}"
tasks:
- name: "test"
Expand Down Expand Up @@ -731,26 +766,27 @@ buildvariants:

- matrix_name: "i18n-fallbacks"
matrix_spec:
ruby: "ruby-2.6"
ruby: "ruby-2.7"
driver: ["current"]
mongodb-version: "4.2"
topology: "standalone"
i18n: '*'
test-i18n-fallbacks: yes
os: rhel80
os: ubuntu-18.04
toolchain: 2024-09-06
display_name: "i18n fallbacks ${rails}, ${driver}, ${mongodb-version}, ${i18n}"
tasks:
- name: "test"

- matrix_name: app-tests-ruby-3
matrix_spec:
ruby: ["ruby-3.0", "ruby-3.1"]
ruby: "ruby-3.1"
driver: ["current"]
mongodb-version: '6.0'
topology: standalone
app-tests: yes
rails: ['6.0', '6.1', '7.0', '7.1']
os: rhel80
os: ubuntu-22.04
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
- name: "test"
Expand All @@ -763,7 +799,8 @@ buildvariants:
topology: standalone
app-tests: yes
rails: ['5.2']
os: rhel80
os: ubuntu-20.04
toolchain: 2024-09-06
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
- name: "test"
Expand All @@ -776,7 +813,7 @@ buildvariants:
topology: standalone
app-tests: yes
rails: ['6.0']
os: ubuntu-22.04
os: ubuntu-18.04
display_name: "app tests ${driver}, ${jruby}"
tasks:
- name: "test"
Expand Down
35 changes: 27 additions & 8 deletions .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,19 @@ axes:
values:
- id: ubuntu-22.04
display_name: "Ubuntu 22.04"
run_on: ubuntu2204-small
- id: ubuntu-20.04
display_name: "Ubuntu 20.04"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: ubuntu2204
- id: ubuntu-18.04
display_name: "Ubuntu 18.04"
run_on: ubuntu1804-small
- id: debian11
display_name: "Debian 11"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: debian11
run_on: debian11-small
- id: rhel80
display_name: "RHEL 8.0"
run_on: ubuntu2004-small
variables:
DOCKER_DISTRO: rhel80
run_on: rhel80-small

- id: "driver"
display_name: Driver Version
Expand Down Expand Up @@ -233,3 +233,22 @@ axes:
variables:
APP_TESTS: yes

- id: toolchain
display_name: Toolchain Version
values:
- id: 2023-05-11
display_name: 2023-05-11
variables:
TOOLCHAIN_OVERRIDE: e8c60866f54bed7e336a37df3a97d6ae1b971b7d
- id: 2023-11-02
display_name: 2023-11-02
variables:
TOOLCHAIN_OVERRIDE: ded7ea845b08cf96f11a747d9540ba3199580dea
- id: 2024-08-07
display_name: 2024-08-07
variables:
TOOLCHAIN_OVERRIDE: c950fe1e85fd7d5e4ea69cc2afff456825583716
- id: 2024-09-06
display_name: 2024-09-06
variables:
TOOLCHAIN_OVERRIDE: deefab59d8f539bdd4a0154505f1e7d39a0857d0
27 changes: 26 additions & 1 deletion .evergreen/config/commands.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ functions:

git submodule update --init --recursive

if [ ! -d .mod ]; then
mkdir -p .mod
cd .mod
git clone https://github.com/mongodb-labs/drivers-evergreen-tools
fi

"fetch egos":
- command: shell.exec
params:
Expand All @@ -35,7 +41,7 @@ functions:
CURRENT_VERSION=latest
fi

export DRIVERS_TOOLS="$(pwd)/../drivers-tools"
export DRIVERS_TOOLS="$(pwd)/.mod/drivers-evergreen-tools"

export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
Expand Down Expand Up @@ -69,6 +75,15 @@ functions:
export SSL=${SSL}
export APP_TESTS=${APP_TESTS}
export DOCKER_DISTRO=${DOCKER_DISTRO}

export MONGODB_URI="${MONGODB_URI}"
export RVM_RUBY="${RVM_RUBY}"
export RAILS="${RAILS}"
export DRIVER="${DRIVER}"
export I18N="${I18N}"
export TEST_I18N_FALLBACKS="${TEST_I18N_FALLBACKS}"
export FLE="${FLE}"
export TOOLCHAIN_OVERRIDE="${TOOLCHAIN_OVERRIDE}"
EOT
# See what we've done
cat expansion.yml
Expand Down Expand Up @@ -241,6 +256,16 @@ functions:
file: ./src/tmp/rspec.xml

"run tests":
- command: shell.exec
type: test
params:
shell: bash
working_dir: "src"
script: |
${PREPARE_SHELL}
.evergreen/run-tests.sh

"run tests in docker":
- command: shell.exec
type: test
params:
Expand Down
Loading

0 comments on commit cdc98d5

Please sign in to comment.