Skip to content

Commit 30afb45

Browse files
RUBY-3500 Fix failing test configurations (#2879)
1 parent 9c709b9 commit 30afb45

File tree

77 files changed

+412
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+412
-243
lines changed

.evergreen/config.yml

+57-4
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ functions:
434434
working_dir: "src"
435435
script: |
436436
${PREPARE_SHELL}
437-
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
437+
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-atlas.sh
438438
439439
"run serverless tests":
440440
- command: shell.exec
@@ -527,6 +527,54 @@ task_groups:
527527
- "test-serverless"
528528

529529
- name: testatlas_task_group
530+
setup_group_can_fail_task: true
531+
setup_group_timeout_secs: 1800 # 30 minutes
532+
setup_group:
533+
- func: fetch source
534+
- func: create expansions
535+
- command: shell.exec
536+
params:
537+
shell: "bash"
538+
working_dir: "src"
539+
script: |
540+
${PREPARE_SHELL}
541+
542+
echo "Setting up Atlas cluster"
543+
544+
DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
545+
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
546+
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
547+
DRIVERS_ATLAS_LAMBDA_USER="${DRIVERS_ATLAS_LAMBDA_USER}" \
548+
DRIVERS_ATLAS_LAMBDA_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}" \
549+
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
550+
MONGODB_VERSION="7.0" \
551+
task_id="${task_id}" \
552+
execution="${execution}" \
553+
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh
554+
555+
echo "MONGODB_URI=${MONGODB_URI}"
556+
- command: expansions.update
557+
params:
558+
file: src/atlas-expansion.yml
559+
teardown_group:
560+
- command: shell.exec
561+
params:
562+
shell: "bash"
563+
working_dir: "src"
564+
script: |
565+
${PREPARE_SHELL}
566+
567+
DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
568+
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
569+
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
570+
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
571+
task_id="${task_id}" \
572+
execution="${execution}" \
573+
$DRIVERS_TOOLS/.evergreen/atlas/teardown-atlas-cluster.sh
574+
tasks:
575+
- test-atlas
576+
577+
- name: testatlas_full_task_group
530578
setup_group_can_fail_task: true
531579
setup_group_timeout_secs: 1800 # 30 minutes
532580
setup_group:
@@ -599,6 +647,8 @@ task_groups:
599647
task_id="${task_id}" \
600648
execution="${execution}" \
601649
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh
650+
651+
echo "MONGODB_URI=${MONGODB_URI}"
602652
- command: expansions.update
603653
params:
604654
file: src/atlas-expansion.yml
@@ -827,6 +877,7 @@ tasks:
827877
script: |
828878
${PREPARE_SHELL}
829879
export MONGODB_URI=${MONGODB_URI}
880+
export FUNCTION_NAME="ruby-driver-lambda"
830881
.evergreen/run-tests-deployed-lambda.sh
831882
env:
832883
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/spec/faas/ruby-sam-app
@@ -1575,7 +1626,9 @@ buildvariants:
15751626

15761627
- matrix_name: aws-auth-regular
15771628
matrix_spec:
1578-
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
1629+
# https://jira.mongodb.org/browse/RUBY-3311
1630+
# auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
1631+
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ]
15791632
ruby: "ruby-3.2"
15801633
topology: standalone
15811634
# needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure
@@ -1805,15 +1858,15 @@ buildvariants:
18051858
os: rhel8
18061859
display_name: "Atlas (Full)"
18071860
tasks:
1808-
- name: testatlas_task_group
1861+
- name: testatlas_full_task_group
18091862

18101863
- matrix_name: "atlas"
18111864
matrix_spec:
18121865
ruby: ["ruby-3.2", "ruby-3.1", "ruby-3.0", "ruby-2.7", "jruby-9.4", "jruby-9.3"]
18131866
os: rhel8
18141867
display_name: "Atlas tests ${ruby}"
18151868
tasks:
1816-
- name: test-atlas
1869+
- name: testatlas_task_group
18171870

18181871
# Commented out, pending RUBY-3414
18191872
# - matrix_name: "serverless"

.evergreen/config/common.yml.erb

+52-1
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ functions:
431431
working_dir: "src"
432432
script: |
433433
${PREPARE_SHELL}
434-
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
434+
MONGODB_URI="${MONGODB_URI}" .evergreen/run-tests-atlas.sh
435435

436436
"run serverless tests":
437437
- command: shell.exec
@@ -524,6 +524,54 @@ task_groups:
524524
- "test-serverless"
525525

526526
- name: testatlas_task_group
527+
setup_group_can_fail_task: true
528+
setup_group_timeout_secs: 1800 # 30 minutes
529+
setup_group:
530+
- func: fetch source
531+
- func: create expansions
532+
- command: shell.exec
533+
params:
534+
shell: "bash"
535+
working_dir: "src"
536+
script: |
537+
${PREPARE_SHELL}
538+
539+
echo "Setting up Atlas cluster"
540+
541+
DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
542+
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
543+
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
544+
DRIVERS_ATLAS_LAMBDA_USER="${DRIVERS_ATLAS_LAMBDA_USER}" \
545+
DRIVERS_ATLAS_LAMBDA_PASSWORD="${DRIVERS_ATLAS_LAMBDA_PASSWORD}" \
546+
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
547+
MONGODB_VERSION="7.0" \
548+
task_id="${task_id}" \
549+
execution="${execution}" \
550+
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh
551+
552+
echo "MONGODB_URI=${MONGODB_URI}"
553+
- command: expansions.update
554+
params:
555+
file: src/atlas-expansion.yml
556+
teardown_group:
557+
- command: shell.exec
558+
params:
559+
shell: "bash"
560+
working_dir: "src"
561+
script: |
562+
${PREPARE_SHELL}
563+
564+
DRIVERS_ATLAS_PUBLIC_API_KEY="${DRIVERS_ATLAS_PUBLIC_API_KEY}" \
565+
DRIVERS_ATLAS_PRIVATE_API_KEY="${DRIVERS_ATLAS_PRIVATE_API_KEY}" \
566+
DRIVERS_ATLAS_GROUP_ID="${DRIVERS_ATLAS_GROUP_ID}" \
567+
LAMBDA_STACK_NAME="dbx-ruby-lambda" \
568+
task_id="${task_id}" \
569+
execution="${execution}" \
570+
$DRIVERS_TOOLS/.evergreen/atlas/teardown-atlas-cluster.sh
571+
tasks:
572+
- test-atlas
573+
574+
- name: testatlas_full_task_group
527575
setup_group_can_fail_task: true
528576
setup_group_timeout_secs: 1800 # 30 minutes
529577
setup_group:
@@ -596,6 +644,8 @@ task_groups:
596644
task_id="${task_id}" \
597645
execution="${execution}" \
598646
$DRIVERS_TOOLS/.evergreen/atlas/setup-atlas-cluster.sh
647+
648+
echo "MONGODB_URI=${MONGODB_URI}"
599649
- command: expansions.update
600650
params:
601651
file: src/atlas-expansion.yml
@@ -824,6 +874,7 @@ tasks:
824874
script: |
825875
${PREPARE_SHELL}
826876
export MONGODB_URI=${MONGODB_URI}
877+
export FUNCTION_NAME="ruby-driver-lambda"
827878
.evergreen/run-tests-deployed-lambda.sh
828879
env:
829880
TEST_LAMBDA_DIRECTORY: ${PROJECT_DIRECTORY}/spec/faas/ruby-sam-app

.evergreen/config/standard.yml.erb

+5-3
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,9 @@ buildvariants:
365365

366366
- matrix_name: aws-auth-regular
367367
matrix_spec:
368-
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
368+
# https://jira.mongodb.org/browse/RUBY-3311
369+
# auth-and-ssl: [ aws-regular, aws-assume-role, aws-ec2, aws-ecs, aws-web-identity ]
370+
auth-and-ssl: [ aws-regular, aws-assume-role, aws-ecs, aws-web-identity ]
369371
ruby: <%= latest_ruby %>
370372
topology: standalone
371373
# needs the latest_5x_mdb because run-tests.sh uses `mongo` to configure
@@ -498,15 +500,15 @@ buildvariants:
498500
os: rhel8
499501
display_name: "Atlas (Full)"
500502
tasks:
501-
- name: testatlas_task_group
503+
- name: testatlas_full_task_group
502504

503505
- matrix_name: "atlas"
504506
matrix_spec:
505507
ruby: <%= supported_rubies %>
506508
os: rhel8
507509
display_name: "Atlas tests ${ruby}"
508510
tasks:
509-
- name: test-atlas
511+
- name: testatlas_task_group
510512

511513
# Commented out, pending RUBY-3414
512514
# - matrix_name: "serverless"

.evergreen/run-deployed-lambda-aws-tests.sh

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ DRIVERS_ATLAS_LAMBDA_PASSWORD
2121
DRIVERS_ATLAS_GROUP_ID
2222
LAMBDA_STACK_NAME
2323
AWS_REGION
24+
FUNCTION_NAME
2425
)
2526

2627
# Ensure that all variables required to run the test are set, otherwise throw

.evergreen/run-tests-atlas.sh

+15-21
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,21 @@ bundle_install
1515
echo "Running specs"
1616

1717
test_status=0
18-
for uri in ATLAS_REPLICA_SET_URI ATLAS_SHARDED_URI ATLAS_FREE_TIER_URI \
19-
ATLAS_TLS11_URI ATLAS_TLS12_URI ATLAS_SERVERLESS_URI ATLAS_SERVERLESS_LB_URI
20-
do
21-
# ${!foo} syntax is bash specific:
22-
# https://stackoverflow.com/questions/14049057/bash-expand-variable-in-a-variable
23-
export ATLAS_URI="${!uri}"
24-
25-
if test -z "$ATLAS_URI"; then
26-
echo "The \$$uri environment variable was not set" 1>&2
27-
test_status=1
28-
fi
29-
30-
bundle exec rspec spec/atlas -fd
31-
this_test_status=$?
32-
echo "TEST STATUS"
33-
echo ${this_test_status}
34-
35-
if test $this_test_status != 0; then
36-
test_status=$this_test_status
37-
fi
38-
done
18+
export ATLAS_URI=$MONGODB_URI
19+
20+
if test -z "$ATLAS_URI"; then
21+
echo "The \$$uri environment variable was not set" 1>&2
22+
test_status=1
23+
fi
24+
25+
bundle exec rspec spec/atlas -fd
26+
this_test_status=$?
27+
echo "TEST STATUS"
28+
echo ${this_test_status}
29+
30+
if test $this_test_status != 0; then
31+
test_status=$this_test_status
32+
fi
3933

4034
kill_jruby
4135

.evergreen/run-tests-deployed-lambda.sh

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ set_env_python
1111
set_env_ruby
1212

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

1617
. `dirname "$0"`/run-deployed-lambda-aws-tests.sh

.mod/drivers-evergreen-tools

profile/driver_bench/rake/tasks.rake

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace :driver_bench do
3030
end
3131

3232
desc 'Runs the DriverBench benchmark suite'
33-
task run: 'driver_bench:initialize' do
33+
task :run do
3434
require_relative '../suite'
3535

3636
Mongo::DriverBench::Suite.run!

spec/integration/client_side_encryption/range_explicit_encryption_prose_spec.rb

+3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
# rubocop:disable RSpec/ExampleLength
88
describe 'Range Explicit Encryption' do
99
min_server_version '7.0.0-rc0'
10+
# https://jira.mongodb.org/browse/RUBY-3457
11+
max_server_version '7.99.99'
12+
1013
require_libmongocrypt
1114
include_context 'define shared FLE helpers'
1215

spec/integration/retryable_reads_errors_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
require 'spec_helper'
55

66
describe 'Retryable reads errors tests' do
7+
retry_test
78

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

spec/integration/sdam_error_handling_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
clean_slate
1010

11+
retry_test
12+
1113
after do
1214
# Close all clients after every test to avoid leaking expectations into
1315
# subsequent tests because we set global assertions on sockets.

spec/lite_spec_helper.rb

-10
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,6 @@ def require_atlas
168168
end
169169
end
170170

171-
if SpecConfig.instance.ci? && !%w(1 true yes).include?(ENV['INTERACTIVE']&.downcase)
172-
# Tests should take under 10 seconds ideally but it seems
173-
# we have some that run for more than 10 seconds in CI.
174-
config.around(:each) do |example|
175-
TimeoutInterrupt.timeout(example_timeout_seconds, ExampleTimeout) do
176-
example.run
177-
end
178-
end
179-
end
180-
181171
if SpecConfig.instance.ci?
182172
if defined?(Rfc::Rif)
183173
unless BSON::Environment.jruby?

spec/mongo/collection_crud_spec.rb

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
require 'spec_helper'
55

66
describe Mongo::Collection do
7+
retry_test
78

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

spec/spec_tests/data/client_side_encryption/fle2v2-BypassQueryAnalysis.yml

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

spec/spec_tests/data/client_side_encryption/fle2v2-Compact.yml

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

spec/spec_tests/data/client_side_encryption/fle2v2-CreateCollection.yml

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

spec/spec_tests/data/client_side_encryption/fle2v2-DecryptExistingData.yml

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

spec/spec_tests/data/client_side_encryption/fle2v2-Delete.yml

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

spec/spec_tests/data/client_side_encryption/fle2v2-EncryptedFields-vs-EncryptedFieldsMap.yml

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

spec/spec_tests/data/client_side_encryption/fle2v2-EncryptedFields-vs-jsonSchema.yml

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

0 commit comments

Comments
 (0)