Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
56 changes: 17 additions & 39 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,27 +238,13 @@ functions:
. ./set-temp-creds.sh
popd

MONGODB_URI="${MONGODB_URI}" \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defining these variables does nothing.

AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
MONGODB_API_VERSION="${MONGODB_API_VERSION}"

export MONGODB_API_VERSION="${MONGODB_API_VERSION}"
export AUTH="auth"
export SSL="ssl"
export SERVERLESS="1"
export SERVERLESS_ATLAS_USER="${SERVERLESS_ATLAS_USER}"
export SERVERLESS_ATLAS_PASSWORD="${SERVERLESS_ATLAS_PASSWORD}"
export SERVERLESS_URI="${SERVERLESS_URI}"
export TEST_CSFLE=true

echo "setting SERVERLESS_URI: $SERVERLESS_URI"

export MONGODB_URI="${SERVERLESS_URI}"
export SINGLE_MONGOS_LB_URI="${SERVERLESS_URI}"

# Setting MULTI_MONGOS to the SERVERLESS_URI is intentional
# LB tests pick one host out of the comma separated list
# so just passing the one host is equivalent
export MULTI_MONGOS_LB_URI="${SERVERLESS_URI}"
source secrets-export.sh
source serverless.env

bash ${PROJECT_DIRECTORY}/.evergreen/run-serverless-tests.sh

Expand Down Expand Up @@ -1427,32 +1413,24 @@ task_groups:
setup_group_timeout_secs: 1800 # 30 minutes
setup_group:
- func: "fetch source"
- command: shell.exec
params:
shell: bash
script: |
${PREPARE_SHELL}
set +o xtrace
LOADBALANCED=ON \
SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \
SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \
SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
- command: expansions.update
- command: subprocess.exec
params:
file: serverless-expansion.yml
working_dir: "src"
binary: bash
env:
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
args:
- .evergreen/setup-serverless.sh

teardown_group:
- func: "upload test results"
- command: shell.exec
- command: subprocess.exec
params:
script: |
${PREPARE_SHELL}
set +o xtrace
SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \
SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \
SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \
SERVERLESS_INSTANCE_NAME=${SERVERLESS_INSTANCE_NAME} \
bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
working_dir: "src"
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh

tasks:
- ".serverless"

Expand Down
54 changes: 15 additions & 39 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,27 +209,13 @@ functions:
. ./set-temp-creds.sh
popd

MONGODB_URI="${MONGODB_URI}" \
AUTH=${AUTH} SSL=${SSL} TEST_CSFLE=true \
MONGODB_API_VERSION="${MONGODB_API_VERSION}"

export MONGODB_API_VERSION="${MONGODB_API_VERSION}"
export AUTH="auth"
export SSL="ssl"
export SERVERLESS="1"
export SERVERLESS_ATLAS_USER="${SERVERLESS_ATLAS_USER}"
export SERVERLESS_ATLAS_PASSWORD="${SERVERLESS_ATLAS_PASSWORD}"
export SERVERLESS_URI="${SERVERLESS_URI}"
export TEST_CSFLE=true

echo "setting SERVERLESS_URI: $SERVERLESS_URI"

export MONGODB_URI="${SERVERLESS_URI}"
export SINGLE_MONGOS_LB_URI="${SERVERLESS_URI}"

# Setting MULTI_MONGOS to the SERVERLESS_URI is intentional
# LB tests pick one host out of the comma separated list
# so just passing the one host is equivalent
export MULTI_MONGOS_LB_URI="${SERVERLESS_URI}"
source secrets-export.sh
source serverless.env

bash ${PROJECT_DIRECTORY}/.evergreen/run-serverless-tests.sh
start-load-balancer:
Expand Down Expand Up @@ -4458,32 +4444,22 @@ task_groups:
setup_group_timeout_secs: 1800
setup_group:
- func: fetch source
- command: shell.exec
params:
shell: bash
script: |
${PREPARE_SHELL}
set +o xtrace
LOADBALANCED=ON \
SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \
SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \
SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh
- command: expansions.update
- command: subprocess.exec
params:
file: serverless-expansion.yml
working_dir: src
binary: bash
env:
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
args:
- .evergreen/setup-serverless.sh
teardown_group:
- func: upload test results
- command: shell.exec
- command: subprocess.exec
params:
script: |
${PREPARE_SHELL}
set +o xtrace
SERVERLESS_DRIVERS_GROUP=${SERVERLESS_DRIVERS_GROUP} \
SERVERLESS_API_PUBLIC_KEY=${SERVERLESS_API_PUBLIC_KEY} \
SERVERLESS_API_PRIVATE_KEY=${SERVERLESS_API_PRIVATE_KEY} \
SERVERLESS_INSTANCE_NAME=${SERVERLESS_INSTANCE_NAME} \
bash ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
working_dir: src
binary: bash
args:
- ${DRIVERS_TOOLS}/.evergreen/serverless/delete-instance.sh
tasks:
- .serverless
- name: test_gcpkms_task_group
Expand Down
1 change: 0 additions & 1 deletion .evergreen/run-serverless-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh

if [ -z ${SERVERLESS+omitted} ]; then echo "SERVERLESS is unset" && exit 1; fi
if [ -z ${SERVERLESS_URI+omitted} ]; then echo "SERVERLESS_URI is unset" && exit 1; fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is never used in our tests because we use the load balanced URIs instead.

if [ -z ${SINGLE_MONGOS_LB_URI+omitted} ]; then echo "SINGLE_MONGOS_LB_URI is unset" && exit 1; fi
if [ -z ${MULTI_MONGOS_LB_URI+omitted} ]; then echo "MULTI_MONGOS_LB_URI is unset" && exit 1; fi
if [ -z ${MONGODB_URI+omitted} ]; then echo "MONGODB_URI is unset" && exit 1; fi
Expand Down
14 changes: 14 additions & 0 deletions .evergreen/setup-serverless.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

bash ${DRIVERS_TOOLS}/.evergreen/secrets_handling/setup-secrets.sh drivers/serverless
bash ${DRIVERS_TOOLS}/.evergreen/serverless/create-instance.sh

cp ${DRIVERS_TOOLS}/.evergreen/serverless/secrets-export.sh .

# generate a source-able expansion file
cat serverless-expansion.yml | sed 's/: /=/g' > serverless.env

echo 'export MONGODB_URI="${SERVERLESS_URI}"' >> serverless.env
echo 'export SINGLE_MONGOS_LB_URI="${SERVERLESS_URI}"' >> serverless.env
echo 'export MULTI_MONGOS_LB_URI="${SERVERLESS_URI}"' >> serverless.env
echo 'export SERVERLESS=1' >> serverless.env
Loading
Loading