Skip to content
Open
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
28 changes: 17 additions & 11 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,10 @@ axes:
- id: "mongodb-version"
display_name: MongoDB Version
values:
- id: "rapid"
display_name: "Rapid"
variables:
MONGODB_VERSION: "rapid"
- id: "8.0"
display_name: "8.0"
variables:
Expand Down Expand Up @@ -1229,7 +1233,7 @@ buildvariants:
- matrix_name: "single-lb"
matrix_spec:
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: load-balanced
single-mongos: single-mongos
os: ubuntu2204
Expand All @@ -1253,7 +1257,7 @@ buildvariants:
- matrix_name: "single-mongos"
matrix_spec:
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: "sharded-cluster"
single-mongos: single-mongos
os: ubuntu2204
Expand Down Expand Up @@ -1288,7 +1292,7 @@ buildvariants:
matrix_spec:
retry-reads: no-retry-reads
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: ["standalone", "replica-set", "sharded-cluster"]
os: ubuntu2204
display_name: "${mongodb-version} ${topology} ${retry-reads} ${ruby}"
Expand All @@ -1300,7 +1304,7 @@ buildvariants:
matrix_spec:
retry-writes: no-retry-writes
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: [replica-set, sharded-cluster]
os: ubuntu2204
display_name: "${mongodb-version} ${topology} ${retry-writes} ${ruby}"
Expand Down Expand Up @@ -1390,7 +1394,7 @@ buildvariants:
matrix_spec:
auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: "replica-set"
compressor: 'zlib'
os: ubuntu2204
Expand All @@ -1403,7 +1407,7 @@ buildvariants:
matrix_spec:
auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: "replica-set"
compressor: 'snappy'
os: ubuntu2204
Expand All @@ -1420,7 +1424,7 @@ buildvariants:
matrix_spec:
auth-and-ssl: [ "auth-and-ssl", "noauth-and-nossl" ]
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: "replica-set"
compressor: 'zstd'
os: ubuntu2204
Expand All @@ -1432,7 +1436,7 @@ buildvariants:
- matrix_name: activesupport-"ruby-4.0"
matrix_spec:
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: replica-set
as: as
os: ubuntu2204
Expand All @@ -1444,7 +1448,7 @@ buildvariants:
- matrix_name: bson-"ruby-4.0"
matrix_spec:
ruby: "ruby-4.0"
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
topology: replica-set
bson: "*"
os: ubuntu2204
Expand Down Expand Up @@ -1519,7 +1523,7 @@ buildvariants:
tasks:
- name: "test-mlaunch"

- matrix_name: "fle above 4.4"
- matrix_name: "fle"
matrix_spec:
auth-and-ssl: "noauth-and-nossl"
ruby: ["ruby-4.0", "ruby-3.4", "ruby-3.3", "ruby-3.2", "ruby-3.1"]
Expand Down Expand Up @@ -1555,6 +1559,8 @@ buildvariants:
# tasks:
# - name: "test-fle"

# Runs specs against the latest server. This is not automatically run on PR's
# because we don't want to block PR's when the latest DB breaks something.
- name: 'latest-server'
activate: false
display_name: 'Latest MongoDB Server'
Expand All @@ -1576,7 +1582,7 @@ buildvariants:
auth-and-ssl: [ aws-regular, aws-assume-role, aws-web-identity ]
ruby: "ruby-4.0"
topology: standalone
mongodb-version: "8.0"
mongodb-version: ["8.0", "rapid"]
os: ubuntu2204
display_name: "AWS ${auth-and-ssl} ${mongodb-version} ${ruby}"
tags: ["pr"]
Expand Down
4 changes: 4 additions & 0 deletions .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ axes:
- id: "mongodb-version"
display_name: MongoDB Version
values:
- id: "rapid"
display_name: "Rapid"
variables:
MONGODB_VERSION: "rapid"
- id: "8.0"
display_name: "8.0"
variables:
Expand Down
21 changes: 13 additions & 8 deletions .evergreen/config/standard.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@
jrubies

# The latest stable version of MongoDB
latest_stable_mdb = "8.0".inspect # so it gets quoted as a string
latest_stable_mdb_raw = "8.0"
latest_stable_mdb = latest_stable_mdb_raw.inspect # so it gets quoted as a string

stable_and_rapid = [ latest_stable_mdb_raw, "rapid" ]

recent_mdb = %w( 8.0 7.0 )
%>
Expand Down Expand Up @@ -112,7 +115,7 @@ buildvariants:
- matrix_name: "single-lb"
matrix_spec:
ruby: <%= latest_ruby %>
mongodb-version: <%= latest_stable_mdb %>
mongodb-version: <%= stable_and_rapid %>
topology: load-balanced
single-mongos: single-mongos
os: ubuntu2204
Expand All @@ -136,7 +139,7 @@ buildvariants:
- matrix_name: "single-mongos"
matrix_spec:
ruby: <%= latest_ruby %>
mongodb-version: <%= latest_stable_mdb %>
mongodb-version: <%= stable_and_rapid %>
topology: "sharded-cluster"
single-mongos: single-mongos
os: ubuntu2204
Expand Down Expand Up @@ -171,7 +174,7 @@ buildvariants:
matrix_spec:
retry-reads: no-retry-reads
ruby: <%= latest_ruby %>
mongodb-version: <%= latest_stable_mdb %>
mongodb-version: <%= stable_and_rapid %>
topology: <%= topologies %>
os: ubuntu2204
display_name: "${mongodb-version} ${topology} ${retry-reads} ${ruby}"
Expand All @@ -183,7 +186,7 @@ buildvariants:
matrix_spec:
retry-writes: no-retry-writes
ruby: <%= latest_ruby %>
mongodb-version: <%= latest_stable_mdb %>
mongodb-version: <%= stable_and_rapid %>
topology: [replica-set, sharded-cluster]
os: ubuntu2204
display_name: "${mongodb-version} ${topology} ${retry-writes} ${ruby}"
Expand Down Expand Up @@ -270,7 +273,7 @@ buildvariants:
- name: "run-main-test-suite"

<% [
[latest_ruby, latest_stable_mdb, 'ubuntu2204'],
[latest_ruby, stable_and_rapid, 'ubuntu2204'],
[supported_mri_ruby_2, '"6.0"', 'ubuntu2004']
].each do |rubies, mdb, distro|
%>
Expand Down Expand Up @@ -342,7 +345,7 @@ buildvariants:
- name: "test-mlaunch"
<% end %>

- matrix_name: "fle above 4.4"
- matrix_name: "fle"
matrix_spec:
auth-and-ssl: "noauth-and-nossl"
ruby: <%= supported_mri_rubies_3_ubuntu %>
Expand Down Expand Up @@ -378,6 +381,8 @@ buildvariants:
# tasks:
# - name: "test-fle"

# Runs specs against the latest server. This is not automatically run on PR's
# because we don't want to block PR's when the latest DB breaks something.
- name: 'latest-server'
activate: false
display_name: 'Latest MongoDB Server'
Expand All @@ -399,7 +404,7 @@ buildvariants:
auth-and-ssl: [ aws-regular, aws-assume-role, aws-web-identity ]
ruby: <%= latest_ruby %>
topology: standalone
mongodb-version: <%= latest_stable_mdb %>
mongodb-version: <%= stable_and_rapid %>
os: ubuntu2204
display_name: "AWS ${auth-and-ssl} ${mongodb-version} ${ruby}"
tags: ["pr"]
Expand Down
9 changes: 9 additions & 0 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ prepare_server

if test "$DOCKER_PRELOAD" != 1; then
install_mlaunch_venv
pip3 install waitress
fi

# Make sure cmake is installed (in case we need to install the libmongocrypt
Expand Down Expand Up @@ -212,6 +213,13 @@ if test -n "$FLE"; then
cd -
fi

# work around error about trying to load a different crypt_shared lib when one
# is already loaded. Note that putting the shared library in the current directory
# means it will always be located, even if crypt_shared_lib_path is not set.
cp ${MONGO_RUBY_DRIVER_CRYPT_SHARED_LIB_PATH} ${PROJECT_DIRECTORY}
export MONGO_RUBY_DRIVER_CRYPT_SHARED_LIB_PATH=${PROJECT_DIRECTORY}/mongo_crypt_v1.so
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PROJECT_DIRECTORY}

# Start the KMS servers first so that they are launching while we are
# fetching libmongocrypt.
if test "$DOCKER_PRELOAD" != 1; then
Expand Down Expand Up @@ -343,6 +351,7 @@ if test "$COMPRESSOR" = zstd; then
add_uri_option compressors=zstd
fi

# TEST_CMD="bundle exec rspec -f d spec/mongo/client_construction_spec.rb"

echo "Running tests"
set +e
Expand Down
2 changes: 1 addition & 1 deletion .mod/drivers-evergreen-tools
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@
}
)
rescue Mongo::Error::KmsError => exc
exc.message.should =~ /Error when connecting to KMS provider|Empty KMS response/
exc.message.should =~ /libmongocrypt error code/
exc.message.should_not =~ /CryptError/
expect(exc.message).to include('libmongocrypt error code')
expect(exc.message).not_to include('CryptError')
else
fail 'Expected to raise KmsError'
end
Expand Down
11 changes: 9 additions & 2 deletions spec/mongo/client_construction_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@

let(:extra_options) do
{
crypt_shared_lib_path: SpecConfig.instance.crypt_shared_lib_path,
crypt_shared_lib_required: SpecConfig.instance.crypt_shared_lib_required,
mongocryptd_uri: mongocryptd_uri,
mongocryptd_bypass_spawn: mongocryptd_bypass_spawn,
mongocryptd_spawn_path: mongocryptd_spawn_path,
Expand Down Expand Up @@ -299,7 +301,12 @@
expect(encryption_options[:extra_options][:mongocryptd_spawn_path]).to eq(mongocryptd_spawn_path)
expect(encryption_options[:extra_options][:mongocryptd_spawn_args]).to eq(mongocryptd_spawn_args)

expect(client.encrypter.mongocryptd_client.options[:monitoring_io]).to be false
if (SpecConfig.instance.crypt_shared_lib_path || '').strip.length > 0
expect(client.encrypter.mongocryptd_client).to be_nil
else
expect(client.encrypter.mongocryptd_client).not_to be_nil
expect(client.encrypter.mongocryptd_client.options[:monitoring_io]).to be false
end
end

context 'with default extra options' do
Expand Down Expand Up @@ -1998,7 +2005,7 @@
block_client.encrypter.mongocryptd_client,
block_client.encrypter.key_vault_client,
block_client.encrypter.metadata_client
].each do |crypt_client|
].compact.each do |crypt_client|
expect(crypt_client.cluster.connected?).to be false
end
end
Expand Down
5 changes: 3 additions & 2 deletions spec/mongo/cursor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,7 @@

context 'when the result set is iterated fully and the cursor id is non-zero' do
min_server_fcv '5.0'
max_server_fcv '8.2' # 8.3 will exhaust the cursor with the last getMore

let(:documents) do
(1..5).map{ |i| { field: "test#{i}" }}
Expand All @@ -592,8 +593,8 @@
end

it 'schedules a kill cursors command' do
get_more_commands = subscriber.started_events.select { |e| e.command_name == 'killCursors' }
expect(get_more_commands.length).to be 1
commands = subscriber.started_events.select { |e| e.command_name == 'killCursors' }
expect(commands.length).to be 1
end
end
end
Expand Down
5 changes: 2 additions & 3 deletions spec/mongo/index/view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@
view_with_session.drop_one('another_-1')
end

let(:failed_operation) do
view_with_session.drop_one('_another_-1')
let(:session) do
client.start_session
end

it_behaves_like 'an operation using a session'
it_behaves_like 'a failed operation using a session'
end

context 'when the index exists' do
Expand Down
Loading