Skip to content

RUBY-3500 Fix failing test configurations #2879

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 14 commits into from
Jul 1, 2024
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
61 changes: 57 additions & 4 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ functions:
working_dir: "src"
script: |
${PREPARE_SHELL}
AUTH=${AUTH} SSL=${SSL} TOPOLOGY=${TOPOLOGY} RVM_RUBY="${RVM_RUBY}" ATLAS_REPLICA_SET_URI=${atlas_replica_set_uri} ATLAS_SHARDED_URI=${atlas_sharded_uri} ATLAS_FREE_TIER_URI=${atlas_free_tier_uri} ATLAS_TLS11_URI=${atlas_tls11_uri} ATLAS_TLS12_URI=${atlas_tls12_uri} ATLAS_SERVERLESS_URI=${atlas_serverless_uri} ATLAS_SERVERLESS_LB_URI=${atlas_serverless_lb_uri} .evergreen/run-tests-atlas.sh
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-atlas.sh

"run serverless tests":
- command: shell.exec
Expand Down Expand Up @@ -527,6 +527,54 @@ task_groups:
- "test-serverless"

- name: testatlas_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: fetch source
- func: create expansions
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

echo "Setting up Atlas cluster"

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
DRIVERS_ATLAS_LAMBDA_USER="${DRIVERS_ATLAS_LAMBDA_USER}" \
DRIVERS_ATLAS_LAMBDA_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
MONGODB_VERSION="7.0" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
teardown_group:
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/teardown-atlas-cluster.sh
tasks:
- test-atlas

- name: testatlas_full_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
Expand Down Expand Up @@ -599,6 +647,8 @@ task_groups:
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
Expand Down Expand Up @@ -827,6 +877,7 @@ tasks:
script: |
${PREPARE_SHELL}
export MONGODB_URI=${MONGODB_URI}
export FUNCTION_NAME="ruby-driver-lambda"
.evergreen/run-tests-deployed-lambda.sh
env:
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/spec/faas/ruby-sam-app
Expand Down Expand Up @@ -1575,7 +1626,9 @@ buildvariants:

- matrix_name: aws-auth-regular
matrix_spec:
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
# https://jira.mongodb.org/browse/RUBY-3311
# auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ]
ruby: "ruby-3.2"
topology: standalone
# needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure
Expand Down Expand Up @@ -1805,15 +1858,15 @@ buildvariants:
os: rhel8
display_name: "Atlas (Full)"
tasks:
- name: testatlas_task_group
- name: testatlas_full_task_group

- matrix_name: "atlas"
matrix_spec:
ruby: ["ruby-3.2", "ruby-3.1", "ruby-3.0", "ruby-2.7", "jruby-9.4", "jruby-9.3"]
os: rhel8
display_name: "Atlas tests ${ruby}"
tasks:
- name: test-atlas
- name: testatlas_task_group

# Commented out, pending RUBY-3414
# - matrix_name: "serverless"
Expand Down
53 changes: 52 additions & 1 deletion .evergreen/config/common.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ functions:
working_dir: "src"
script: |
${PREPARE_SHELL}
AUTH=${AUTH} SSL=${SSL} TOPOLOGY=${TOPOLOGY} RVM_RUBY="${RVM_RUBY}" ATLAS_REPLICA_SET_URI=${atlas_replica_set_uri} ATLAS_SHARDED_URI=${atlas_sharded_uri} ATLAS_FREE_TIER_URI=${atlas_free_tier_uri} ATLAS_TLS11_URI=${atlas_tls11_uri} ATLAS_TLS12_URI=${atlas_tls12_uri} ATLAS_SERVERLESS_URI=${atlas_serverless_uri} ATLAS_SERVERLESS_LB_URI=${atlas_serverless_lb_uri} .evergreen/run-tests-atlas.sh
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-atlas.sh

"run serverless tests":
- command: shell.exec
Expand Down Expand Up @@ -524,6 +524,54 @@ task_groups:
- "test-serverless"

- name: testatlas_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: fetch source
- func: create expansions
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

echo "Setting up Atlas cluster"

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
DRIVERS_ATLAS_LAMBDA_USER="${DRIVERS_ATLAS_LAMBDA_USER}" \
DRIVERS_ATLAS_LAMBDA_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
MONGODB_VERSION="7.0" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
teardown_group:
- command: shell.exec
params:
shell: "bash"
working_dir: "src"
script: |
${PREPARE_SHELL}

DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/teardown-atlas-cluster.sh
tasks:
- test-atlas

- name: testatlas_full_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
Expand Down Expand Up @@ -596,6 +644,8 @@ task_groups:
task_id="${task_id}" \
execution="${execution}" \
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh

echo "MONGODB_URI=${MONGODB_URI}"
- command: expansions.update
params:
file: src/atlas-expansion.yml
Expand Down Expand Up @@ -824,6 +874,7 @@ tasks:
script: |
${PREPARE_SHELL}
export MONGODB_URI=${MONGODB_URI}
export FUNCTION_NAME="ruby-driver-lambda"
.evergreen/run-tests-deployed-lambda.sh
env:
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/spec/faas/ruby-sam-app
Expand Down
8 changes: 5 additions & 3 deletions .evergreen/config/standard.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,9 @@ buildvariants:

- matrix_name: aws-auth-regular
matrix_spec:
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
# https://jira.mongodb.org/browse/RUBY-3311
# auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ]
ruby: <%= latest_ruby %>
topology: standalone
# needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure
Expand Down Expand Up @@ -498,15 +500,15 @@ buildvariants:
os: rhel8
display_name: "Atlas (Full)"
tasks:
- name: testatlas_task_group
- name: testatlas_full_task_group

- matrix_name: "atlas"
matrix_spec:
ruby: <%= supported_rubies %>
os: rhel8
display_name: "Atlas tests ${ruby}"
tasks:
- name: test-atlas
- name: testatlas_task_group

# Commented out, pending RUBY-3414
# - matrix_name: "serverless"
Expand Down
1 change: 1 addition & 0 deletions .evergreen/run-deployed-lambda-aws-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ DRIVERS_ATLAS_LAMBDA_PASSWORD
DRIVERS_ATLAS_GROUP_ID
LAMBDA_STACK_NAME
AWS_REGION
FUNCTION_NAME
)

# Ensure that all variables required to run the test are set, otherwise throw
Expand Down
36 changes: 15 additions & 21 deletions .evergreen/run-tests-atlas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,21 @@ bundle_install
echo "Running specs"

test_status=0
for uri in ATLAS_REPLICA_SET_URI ATLAS_SHARDED_URI ATLAS_FREE_TIER_URI \
ATLAS_TLS11_URI ATLAS_TLS12_URI ATLAS_SERVERLESS_URI ATLAS_SERVERLESS_LB_URI
do
# ${!foo} syntax is bash specific:
# https://stackoverflow.com/questions/14049057/bash-expand-variable-in-a-variable
export ATLAS_URI="${!uri}"

if test -z "$ATLAS_URI"; then
echo "The \$$uri environment variable was not set" 1>&2
test_status=1
fi

bundle exec rspec spec/atlas -fd
this_test_status=$?
echo "TEST STATUS"
echo ${this_test_status}

if test $this_test_status != 0; then
test_status=$this_test_status
fi
done
export ATLAS_URI=$MONGODB_URI

if test -z "$ATLAS_URI"; then
echo "The \$$uri environment variable was not set" 1>&2
test_status=1
fi

bundle exec rspec spec/atlas -fd
this_test_status=$?
echo "TEST STATUS"
echo ${this_test_status}

if test $this_test_status != 0; then
test_status=$this_test_status
fi

kill_jruby

Expand Down
1 change: 1 addition & 0 deletions .evergreen/run-tests-deployed-lambda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set_env_python
set_env_ruby

export MONGODB_URI=${MONGODB_URI}
export CLUSTER_PREFIX="ruby-driver-"
export TEST_LAMBDA_DIRECTORY=`dirname "$0"`/../spec/faas/ruby-sam-app

. `dirname "$0"`/run-deployed-lambda-aws-tests.sh
2 changes: 1 addition & 1 deletion .mod/drivers-evergreen-tools
2 changes: 1 addition & 1 deletion profile/driver_bench/rake/tasks.rake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace :driver_bench do
end

desc 'Runs the DriverBench benchmark suite'
task run: 'driver_bench:initialize' do
task :run do
require_relative '../suite'

Mongo::DriverBench::Suite.run!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# rubocop:disable RSpec/ExampleLength
describe 'Range Explicit Encryption' do
min_server_version '7.0.0-rc0'
# https://jira.mongodb.org/browse/RUBY-3457
max_server_version '7.99.99'

require_libmongocrypt
include_context 'define shared FLE helpers'

Expand Down
1 change: 1 addition & 0 deletions spec/integration/retryable_reads_errors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'spec_helper'

describe 'Retryable reads errors tests' do
retry_test

let(:client) { authorized_client.with(options.merge(retry_reads: true)) }

Expand Down
2 changes: 2 additions & 0 deletions spec/integration/sdam_error_handling_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

clean_slate

retry_test

after do
# Close all clients after every test to avoid leaking expectations into
# subsequent tests because we set global assertions on sockets.
Expand Down
10 changes: 0 additions & 10 deletions spec/lite_spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,6 @@ def require_atlas
end
end

if SpecConfig.instance.ci? && !%w(1 true yes).include?(ENV['INTERACTIVE']&.downcase)
# Tests should take under 10 seconds ideally but it seems
# we have some that run for more than 10 seconds in CI.
config.around(:each) do |example|
TimeoutInterrupt.timeout(example_timeout_seconds, ExampleTimeout) do
example.run
end
end
end

if SpecConfig.instance.ci?
if defined?(Rfc::Rif)
unless BSON::Environment.jruby?
Expand Down
1 change: 1 addition & 0 deletions spec/mongo/collection_crud_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
require 'spec_helper'

describe Mongo::Collection do
retry_test

let(:subscriber) { Mrss::EventSubscriber.new }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Requires libmongocrypt 1.8.0.
runOn:
- minServerVersion: "7.0.0"
maxServerVersion: "7.99.99"
# Skip QEv2 (also referred to as FLE2v2) tests on Serverless. Unskip once Serverless enables the QEv2 protocol.
# FLE 2 Encrypted collections are not supported on standalone.
topology: [ "replicaset", "sharded", "load-balanced" ]
Expand Down
Loading
Loading