Skip to content

Commit 4022460

Browse files
RUBY-3070 Add atlas to main test suite (#2669)
1 parent d3c2d72 commit 4022460

File tree

9 files changed

+84
-984
lines changed

9 files changed

+84
-984
lines changed

.evergreen/config-atlas.yml

Lines changed: 0 additions & 868 deletions
This file was deleted.

.evergreen/config.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,23 @@ functions:
129129
export OCSP_CONNECTIVITY="${OCSP_CONNECTIVITY}"
130130
export OCSP_VERIFIER="${OCSP_VERIFIER}"
131131
132+
export ATLAS_REPLICA_SET_URI="${atlas_replica_set_uri}"
133+
export ATLAS_SHARDED_URI="${atlas_sharded_uri}"
134+
export ATLAS_FREE_TIER_URI="${atlas_free_tier_uri}"
135+
export ATLAS_TLS11_URI="${atlas_tls11_uri}"
136+
export ATLAS_TLS12_URI="${atlas_tls12_uri}"
137+
export ATLAS_SERVERLESS_URI="${atlas_serverless_uri}"
138+
export ATLAS_SERVERLESS_LB_URI="${atlas_serverless_lb_uri}"
139+
export RVM_RUBY="${RVM_RUBY}"
140+
export SERVERLESS_DRIVERS_GROUP="${SERVERLESS_DRIVERS_GROUP}"
141+
export SERVERLESS_API_PUBLIC_KEY="${SERVERLESS_API_PUBLIC_KEY}"
142+
export SERVERLESS_API_PRIVATE_KEY="${SERVERLESS_API_PRIVATE_KEY}"
143+
export SERVERLESS_ATLAS_USER="${SERVERLESS_ATLAS_USER}"
144+
export SERVERLESS_ATLAS_PASSWORD="${SERVERLESS_ATLAS_PASSWORD}"
145+
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
146+
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
147+
export AWS_DEFAULT_REGION="${fle_aws_region}"
148+
132149
# Needed for generating temporary aws credentials.
133150
if [ -n "${FLE}" ];
134151
then
@@ -460,6 +477,7 @@ post:
460477
- func: "upload mo artifacts"
461478
#- func: "upload test results"
462479
- func: "upload test results to s3"
480+
- func: "delete serverless instance"
463481

464482
task_groups:
465483
- name: testgcpkms_task_group
@@ -500,7 +518,13 @@ task_groups:
500518
- testgcpkms-task
501519

502520
tasks:
503-
521+
- name: "test-atlas"
522+
commands:
523+
- func: "run Atlas tests"
524+
- name: "test-serverless"
525+
commands:
526+
- func: "export FLE credentials"
527+
- func: "run serverless tests"
504528
- name: "test-docker"
505529
commands:
506530
- func: "build and test docker image"
@@ -1731,3 +1755,21 @@ buildvariants:
17311755
- name: testgcpkms_task_group
17321756
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README
17331757

1758+
- matrix_name: "atlas"
1759+
matrix_spec:
1760+
ruby: ["ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "jruby-9.2"]
1761+
display_name: "Atlas tests ${ruby}"
1762+
run_on:
1763+
- ubuntu1804-small
1764+
tasks:
1765+
- name: test-atlas
1766+
1767+
- matrix_name: "serverless"
1768+
matrix_spec:
1769+
ruby: ["ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "jruby-9.2"]
1770+
fle: helper
1771+
display_name: "Atlas serverless ${ruby} single mongos"
1772+
run_on:
1773+
- ubuntu1804-small
1774+
tasks:
1775+
- name: test-serverless

.evergreen/config/atlas.yml.erb

Lines changed: 0 additions & 19 deletions
This file was deleted.

.evergreen/config/common.yml.erb

Lines changed: 17 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -50,74 +50,6 @@ functions:
5050
curl --retry 3 -sfLo egos.c https://raw.githubusercontent.com/p-mongo/egos/master/egos.c
5151
gcc -O2 -g -oegos -lrt egos.c
5252

53-
<% if @atlas %>
54-
"create expansions":
55-
# Make an evergreen expansion file with dynamic values
56-
- command: shell.exec
57-
params:
58-
working_dir: "src"
59-
script: |
60-
# Get the current unique version of this checkout
61-
if [ "${is_patch}" = "true" ]; then
62-
CURRENT_VERSION=$(git describe)-patch-${version_id}
63-
else
64-
CURRENT_VERSION=latest
65-
fi
66-
67-
export DRIVERS_TOOLS="$(pwd)/.mod/drivers-evergreen-tools"
68-
69-
# Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
70-
if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
71-
export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
72-
fi
73-
74-
export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration"
75-
export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin"
76-
export UPLOAD_BUCKET="${project}"
77-
export PROJECT_DIRECTORY="$(pwd)"
78-
79-
cat <<EOT > expansion.yml
80-
CURRENT_VERSION: "$CURRENT_VERSION"
81-
DRIVERS_TOOLS: "$DRIVERS_TOOLS"
82-
MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME"
83-
MONGODB_BINARIES: "$MONGODB_BINARIES"
84-
UPLOAD_BUCKET: "$UPLOAD_BUCKET"
85-
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY"
86-
PREPARE_SHELL: |
87-
set -o errexit
88-
set -o xtrace
89-
export DRIVERS_TOOLS="$DRIVERS_TOOLS"
90-
export MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME"
91-
export MONGODB_BINARIES="$MONGODB_BINARIES"
92-
export UPLOAD_BUCKET="$UPLOAD_BUCKET"
93-
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY"
94-
95-
# TMPDIR cannot be too long, see
96-
# https://github.com/broadinstitute/cromwell/issues/3647.
97-
# Why is it even set at all?
98-
#export TMPDIR="$MONGO_ORCHESTRATION_HOME/db"
99-
export PATH="$MONGODB_BINARIES:$PATH"
100-
export PROJECT="${project}"
101-
export ATLAS_REPLICA_SET_URI="${atlas_replica_set_uri}"
102-
export ATLAS_SHARDED_URI="${atlas_sharded_uri}"
103-
export ATLAS_FREE_TIER_URI="${atlas_free_tier_uri}"
104-
export ATLAS_TLS11_URI="${atlas_tls11_uri}"
105-
export ATLAS_TLS12_URI="${atlas_tls12_uri}"
106-
export ATLAS_SERVERLESS_URI="${atlas_serverless_uri}"
107-
export ATLAS_SERVERLESS_LB_URI="${atlas_serverless_lb_uri}"
108-
export RVM_RUBY="${RVM_RUBY}"
109-
export SERVERLESS_DRIVERS_GROUP="${SERVERLESS_DRIVERS_GROUP}"
110-
export SERVERLESS_API_PUBLIC_KEY="${SERVERLESS_API_PUBLIC_KEY}"
111-
export SERVERLESS_API_PRIVATE_KEY="${SERVERLESS_API_PRIVATE_KEY}"
112-
export SERVERLESS_ATLAS_USER="${SERVERLESS_ATLAS_USER}"
113-
export SERVERLESS_ATLAS_PASSWORD="${SERVERLESS_ATLAS_PASSWORD}"
114-
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
115-
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
116-
export AWS_DEFAULT_REGION="${fle_aws_region}"
117-
EOT
118-
# See what we've done
119-
cat expansion.yml
120-
<% else %>
12153
"create expansions":
12254
# Make an evergreen expansion file with dynamic values
12355
- command: shell.exec
@@ -195,6 +127,23 @@ functions:
195127
export OCSP_CONNECTIVITY="${OCSP_CONNECTIVITY}"
196128
export OCSP_VERIFIER="${OCSP_VERIFIER}"
197129

130+
export ATLAS_REPLICA_SET_URI="${atlas_replica_set_uri}"
131+
export ATLAS_SHARDED_URI="${atlas_sharded_uri}"
132+
export ATLAS_FREE_TIER_URI="${atlas_free_tier_uri}"
133+
export ATLAS_TLS11_URI="${atlas_tls11_uri}"
134+
export ATLAS_TLS12_URI="${atlas_tls12_uri}"
135+
export ATLAS_SERVERLESS_URI="${atlas_serverless_uri}"
136+
export ATLAS_SERVERLESS_LB_URI="${atlas_serverless_lb_uri}"
137+
export RVM_RUBY="${RVM_RUBY}"
138+
export SERVERLESS_DRIVERS_GROUP="${SERVERLESS_DRIVERS_GROUP}"
139+
export SERVERLESS_API_PUBLIC_KEY="${SERVERLESS_API_PUBLIC_KEY}"
140+
export SERVERLESS_API_PRIVATE_KEY="${SERVERLESS_API_PRIVATE_KEY}"
141+
export SERVERLESS_ATLAS_USER="${SERVERLESS_ATLAS_USER}"
142+
export SERVERLESS_ATLAS_PASSWORD="${SERVERLESS_ATLAS_PASSWORD}"
143+
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
144+
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
145+
export AWS_DEFAULT_REGION="${fle_aws_region}"
146+
198147
# Needed for generating temporary aws credentials.
199148
if [ -n "${FLE}" ];
200149
then
@@ -206,7 +155,6 @@ functions:
206155

207156
# See what we've done
208157
cat expansion.yml
209-
<% end %>
210158

211159
# Load the expansion file to make an evergreen variable with the current
212160
# unique version
@@ -527,11 +475,8 @@ post:
527475
- func: "upload mo artifacts"
528476
#- func: "upload test results"
529477
- func: "upload test results to s3"
530-
<% if @atlas %>
531478
- func: "delete serverless instance"
532-
<% end %>
533479

534-
<% unless @atlas %>
535480
task_groups:
536481
- name: testgcpkms_task_group
537482
setup_group_can_fail_task: true
@@ -569,19 +514,15 @@ task_groups:
569514
.evergreen/csfle/gcpkms/delete-instance.sh
570515
tasks:
571516
- testgcpkms-task
572-
<% end %>
573517

574518
tasks:
575-
576-
<% if @atlas %>
577519
- name: "test-atlas"
578520
commands:
579521
- func: "run Atlas tests"
580522
- name: "test-serverless"
581523
commands:
582524
- func: "export FLE credentials"
583525
- func: "run serverless tests"
584-
<% else %>
585526
- name: "test-docker"
586527
commands:
587528
- func: "build and test docker image"
@@ -642,4 +583,3 @@ tasks:
642583
export GCPKMS_ZONE=${GCPKMS_ZONE}
643584
export GCPKMS_INSTANCENAME=${GCPKMS_INSTANCENAME}
644585
GCPKMS_CMD="TEST_FLE_GCP_AUTO=1 RVM_RUBY=ruby-3.1 FLE=helper TOPOLOGY=standalone MONGODB_VERSION=6.0 MONGO_RUBY_DRIVER_GCP_EMAIL="${fle_gcp_email}" MONGO_RUBY_DRIVER_GCP_PRIVATE_KEY='${fle_gcp_private_key}' MONGO_RUBY_DRIVER_GCP_PROJECT_ID='${fle_gcp_project_id}' MONGO_RUBY_DRIVER_GCP_LOCATION='${fle_gcp_location}' MONGO_RUBY_DRIVER_GCP_KEY_RING='${fle_gcp_key_ring}' MONGO_RUBY_DRIVER_GCP_KEY_NAME='${fle_gcp_key_name}' ./.evergreen/run-tests-gcp.sh" .evergreen/csfle/gcpkms/run-command.sh
645-
<% end %>

.evergreen/config/standard.yml.erb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,3 +655,21 @@ buildvariants:
655655
- name: testgcpkms_task_group
656656
batchtime: 20160 # Use a batchtime of 14 days as suggested by the CSFLE test README
657657

658+
- matrix_name: "atlas"
659+
matrix_spec:
660+
ruby: ["ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "jruby-9.2"]
661+
display_name: "Atlas tests ${ruby}"
662+
run_on:
663+
- ubuntu1804-small
664+
tasks:
665+
- name: test-atlas
666+
667+
- matrix_name: "serverless"
668+
matrix_spec:
669+
ruby: ["ruby-2.5", "ruby-2.6", "ruby-2.7", "ruby-3.0", "ruby-3.1", "jruby-9.2"]
670+
fle: helper
671+
display_name: "Atlas serverless ${ruby} single mongos"
672+
run_on:
673+
- ubuntu1804-small
674+
tasks:
675+
- name: test-serverless

.evergreen/run-tests-atlas.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ do
2121
# ${!foo} syntax is bash specific:
2222
# https://stackoverflow.com/questions/14049057/bash-expand-variable-in-a-variable
2323
export ATLAS_URI="${!uri}"
24-
24+
2525
if test -z "$ATLAS_URI"; then
2626
echo "The \$$uri environment variable was not set" 1>&2
2727
test_status=1

.evergreen/run-tests-serverless.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,6 @@ bundle exec rspec \
8181
kill_jruby
8282
# Terminate all kmip servers... and whatever else happens to be running
8383
# that is a python script.
84-
pkill python3
84+
pkill python
8585

8686
exit ${test_status}

.evergreen/update-evergreen-configs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ autoload :YAML, 'yaml'
88
class Runner
99
def run
1010
transform('config.yml')
11-
12-
@atlas = true
13-
transform('config-atlas.yml')
1411
end
1512

1613
def transform(output_file_name)
@@ -27,13 +24,8 @@ EOT
2724
template_path = File.join(File.dirname(__FILE__), 'config/axes.yml.erb')
2825
contents << Tilt.new(template_path, engine_class: Erubi::CaptureEndEngine).render(self)
2926

30-
if @atlas
31-
template_path = File.join(File.dirname(__FILE__), 'config/atlas.yml.erb')
32-
contents << Tilt.new(template_path, engine_class: Erubi::CaptureEndEngine).render(self)
33-
else
34-
template_path = File.join(File.dirname(__FILE__), 'config/standard.yml.erb')
35-
contents << Tilt.new(template_path, engine_class: Erubi::CaptureEndEngine).render(self)
36-
end
27+
template_path = File.join(File.dirname(__FILE__), 'config/standard.yml.erb')
28+
contents << Tilt.new(template_path, engine_class: Erubi::CaptureEndEngine).render(self)
3729

3830
output_path = File.join(File.dirname(__FILE__), output_file_name)
3931
File.open(output_path, 'w') do |f|

spec/atlas/operations_spec.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@
1313
end
1414
end
1515

16-
describe 'list_collections' do
17-
# Atlas free tier proxy enforces restrictions on list_collections
18-
# arguments. This tests verifies that list_collections works on Atlas
19-
16+
describe 'ping' do
2017
it 'works' do
21-
# We are not allowed to mutate the database, therefore the list of
22-
# collections would generally be empty.
2318
expect do
24-
client.database.list_collections
19+
client.database.command(ping: 1)
2520
end.not_to raise_error
2621
end
2722
end

0 commit comments

Comments
 (0)