Skip to content

Commit

Permalink
RUBY-3384 Update serverless tests
Browse files Browse the repository at this point in the history
  • Loading branch information
comandeo-mongo committed Jan 26, 2024
1 parent 60d1f69 commit b72204f
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 113 deletions.
150 changes: 94 additions & 56 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,25 +124,8 @@ functions:
export ATLAS_SERVERLESS_LB_URI="${atlas_serverless_lb_uri}"
export RVM_RUBY="${RVM_RUBY}"
if [[ -n "${USE_PROXY_SERVERLESS}" ]];
then
export SERVERLESS_DRIVERS_GROUP="${PROXY_SERVERLESS_DRIVERS_GROUP}"
else
export SERVERLESS_DRIVERS_GROUP="${SERVERLESS_DRIVERS_GROUP}"
fi
export SERVERLESS_API_PUBLIC_KEY="${SERVERLESS_API_PUBLIC_KEY}"
export SERVERLESS_API_PRIVATE_KEY="${SERVERLESS_API_PRIVATE_KEY}"
export SERVERLESS_ATLAS_USER="${SERVERLESS_ATLAS_USER}"
export SERVERLESS_ATLAS_PASSWORD="${SERVERLESS_ATLAS_PASSWORD}"
# Needed for generating temporary aws credentials.
if [ -n "${FLE}" ];
then
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
export AWS_DEFAULT_REGION="${fle_aws_region}"
fi
EOT
# See what we've done
Expand All @@ -154,17 +137,6 @@ functions:
params:
file: src/expansion.yml

"delete serverless instance":
- command: shell.exec
params:
working_dir: "src"
shell: bash
script: |
${PREPARE_SHELL}
if [[ -n "${SERVERLESS_INSTANCE_NAME}" ]]; then
SERVERLESS_INSTANCE_NAME=${SERVERLESS_INSTANCE_NAME} .evergreen/serverless/delete-instance.sh
fi
"export AWS auth credentials":
- command: shell.exec
type: test
Expand Down Expand Up @@ -385,6 +357,13 @@ functions:
working_dir: "src"
script: |
${PREPARE_SHELL}
# Needed for generating temporary aws credentials.
if [ -n "${FLE}" ];
then
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
export AWS_DEFAULT_REGION="${fle_aws_region}"
fi
.evergreen/run-tests.sh
"run tests via docker":
Expand All @@ -395,6 +374,13 @@ functions:
working_dir: "src"
script: |
${PREPARE_SHELL}
# Needed for generating temporary aws credentials.
if [ -n "${FLE}" ];
then
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
export AWS_DEFAULT_REGION="${fle_aws_region}"
fi
.evergreen/run-tests-docker.sh
"run AWS auth tests":
Expand Down Expand Up @@ -438,28 +424,21 @@ functions:
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
"run serverless tests":
- command: shell.exec
params:
shell: bash
working_dir: "src"
script: |
${PREPARE_SHELL}
# This hack with PROJECT env is necessary while serverless
# rejects creating instances with too long names.
PROJECT="mongo-ruby-driver" LOADBALANCED="ON" .evergreen/serverless/create-instance.sh
cat serverless-expansion.yml
- command: expansions.update
params:
file: src/serverless-expansion.yml

- command: shell.exec
type: test
params:
shell: bash
working_dir: "src"
script: |
${PREPARE_SHELL}
# Needed for generating temporary aws credentials.
if [ -n "${FLE}" ];
then
export AWS_ACCESS_KEY_ID="${fle_aws_key}"
export AWS_SECRET_ACCESS_KEY="${fle_aws_secret}"
export AWS_DEFAULT_REGION="${fle_aws_region}"
fi
CRYPT_SHARED_LIB_PATH="${CRYPT_SHARED_LIB_PATH}" SERVERLESS=1 SSL=ssl RVM_RUBY="${RVM_RUBY}" SINGLE_MONGOS="${SINGLE_MONGOS}" SERVERLESS_URI="${SERVERLESS_URI}" FLE="${FLE}" SERVERLESS_MONGODB_VERSION="${SERVERLESS_MONGODB_VERSION}" .evergreen/run-tests-serverless.sh
pre:
Expand All @@ -473,9 +452,67 @@ post:
- func: "upload mo artifacts"
#- func: "upload test results"
- func: "upload test results to s3"
- func: "delete serverless instance"

task_groups:
- name: serverless_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: "fetch source"
- func: "create expansions"
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
- command: expansions.update
params:
file: serverless-expansion.yml
teardown_task:
- command: shell.exec
params:
script: |
${PREPARE_SHELL}
bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
- func: "upload test results"
tasks:
- "test-serverless"

- name: serverless_next_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: "fetch source"
- func: "create expansions"
- command: ec2.assume_role
params:
role_arn: ${aws_test_secrets_role}
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh serverless_next
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
- command: expansions.update
params:
file: serverless-expansion.yml
teardown_task:
- command: shell.exec
params:
script: |
${PREPARE_SHELL}
bash ${DRIVERS_TOOLS}/.evergreen/serverless/setup-secrets.sh serverless_next
bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
- func: "upload test results"
tasks:
- "test-serverless"

- name: testatlas_task_group
setup_group_can_fail_task: true
setup_group_timeout_secs: 1800 # 30 minutes
Expand Down Expand Up @@ -1204,15 +1241,6 @@ axes:
- id: no
display_name: No

- id: serverless-project
display_name: serverless project
values:
- id: original
display_name: Original
- id: proxy
display_name: Proxy
variables:
USE_PROXY_SERVERLESS: 1

buildvariants:
- matrix_name: "auth/ssl"
Expand Down Expand Up @@ -1788,10 +1816,20 @@ buildvariants:
ruby: ["ruby-3.2", "ruby-3.1", "ruby-3.0", "ruby-2.7", "ruby-2.6", "ruby-2.5"]
fle: path
os: rhel8
serverless-project: [ original, proxy ]
display_name: "Atlas serverless ${ruby} ${serverless-project}"
display_name: "Atlas serverless ${ruby}"
tasks:
- name: serverless_task_group

- matrix_name: "serverless-next"
matrix_spec:
# https://jira.mongodb.org/browse/RUBY-3217
# ruby: ["ruby-3.2", "ruby-3.1", "ruby-3.0", "ruby-2.7", "ruby-2.6", "ruby-2.5", "jruby-9.3", "jruby-9.2"]
ruby: ["ruby-3.2", "ruby-3.1", "ruby-3.0", "ruby-2.7", "ruby-2.6", "ruby-2.5"]
fle: path
os: rhel8
display_name: "Atlas serverless-next ${ruby}"
tasks:
- name: test-serverless
- name: serverless_next_task_group

- matrix_name: "aws-lambda"
matrix_spec:
Expand Down
9 changes: 0 additions & 9 deletions .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,3 @@ axes:
- id: no
display_name: No

- id: serverless-project
display_name: serverless project
values:
- id: original
display_name: Original
- id: proxy
display_name: Proxy
variables:
USE_PROXY_SERVERLESS: 1
Loading

0 comments on commit b72204f

Please sign in to comment.