Skip to content
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

feat(NODE-5908): support range v2 #4141

Merged
merged 8 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
17 changes: 13 additions & 4 deletions .evergreen/config.in.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ functions:
- command: shell.exec
type: test
params:
shell: bash
working_dir: src
timeout_secs: 300
script: |
Expand Down Expand Up @@ -475,8 +476,6 @@ functions:
export AWS_CMK_ID='${AWS_CMK_ID}'
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
EOT
- command: shell.exec
type: test
Expand Down Expand Up @@ -914,8 +913,6 @@ functions:
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
export AWS_REGION='${AWS_REGION}'
export AWS_CMK_ID='${AWS_CMK_ID}'
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
EOT
- command: shell.exec
type: test
Expand Down Expand Up @@ -1074,6 +1071,18 @@ functions:
args:
- ${PROJECT_DIRECTORY}/.evergreen/run-x509-tests.sh

install mongodb-client-encryption:
- command: subprocess.exec
type: setup
params:
working_dir: "src"
env:
INSTALL_DIR: mongodb-client-encryption
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
binary: bash
args:
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh

tasks:
- name: 'test-atlas-data-lake'
tags: ["datalake", "mongohouse"]
Expand Down
108 changes: 41 additions & 67 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ functions:
- command: shell.exec
type: test
params:
shell: bash
working_dir: src
timeout_secs: 300
script: |
Expand Down Expand Up @@ -428,8 +429,6 @@ functions:
export AWS_CMK_ID='${AWS_CMK_ID}'
export AWS_ACCESS_KEY_ID='${AWS_ACCESS_KEY_ID}'
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
EOT
- command: shell.exec
type: test
Expand Down Expand Up @@ -886,8 +885,6 @@ functions:
export AWS_SECRET_ACCESS_KEY='${AWS_SECRET_ACCESS_KEY}'
export AWS_REGION='${AWS_REGION}'
export AWS_CMK_ID='${AWS_CMK_ID}'
export CSFLE_GIT_REF='${CSFLE_GIT_REF}'
export CDRIVER_GIT_REF='${CDRIVER_GIT_REF}'
EOT
- command: shell.exec
type: test
Expand Down Expand Up @@ -1035,6 +1032,17 @@ functions:
binary: bash
args:
- ${PROJECT_DIRECTORY}/.evergreen/run-x509-tests.sh
install mongodb-client-encryption:
- command: subprocess.exec
type: setup
params:
working_dir: src
env:
INSTALL_DIR: mongodb-client-encryption
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
binary: bash
args:
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
tasks:
- name: test-atlas-data-lake
tags:
Expand Down Expand Up @@ -3516,7 +3524,7 @@ tasks:
variant: '*'
status: '*'
patch_optional: true
- name: run-custom-csfle-tests-5.0-pinned-commit
- name: run-custom-csfle-tests-5.0
tags:
- run-custom-dependency-tests
commands:
Expand All @@ -3528,46 +3536,12 @@ tasks:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '5.0'}
- {key: TOPOLOGY, value: replica_set}
- {key: CSFLE_GIT_REF, value: 974a4614f8c1c3786e5e39fa63568d83f4f69ebd}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run custom csfle tests
- name: run-custom-csfle-tests-5.0-master
tags:
- run-custom-dependency-tests
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: '16'}
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '5.0'}
- {key: TOPOLOGY, value: replica_set}
- {key: CSFLE_GIT_REF, value: master}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run custom csfle tests
- name: run-custom-csfle-tests-rapid-pinned-commit
tags:
- run-custom-dependency-tests
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: '16'}
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: rapid}
- {key: TOPOLOGY, value: replica_set}
- {key: CSFLE_GIT_REF, value: 974a4614f8c1c3786e5e39fa63568d83f4f69ebd}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: install mongodb-client-encryption
- func: run custom csfle tests
- name: run-custom-csfle-tests-rapid-master
- name: run-custom-csfle-tests-rapid
tags:
- run-custom-dependency-tests
commands:
Expand All @@ -3579,12 +3553,12 @@ tasks:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: rapid}
- {key: TOPOLOGY, value: replica_set}
- {key: CSFLE_GIT_REF, value: master}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: install mongodb-client-encryption
- func: run custom csfle tests
- name: run-custom-csfle-tests-latest-pinned-commit
- name: run-custom-csfle-tests-latest
tags:
- run-custom-dependency-tests
commands:
Expand All @@ -3596,27 +3570,10 @@ tasks:
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: latest}
- {key: TOPOLOGY, value: replica_set}
- {key: CSFLE_GIT_REF, value: 974a4614f8c1c3786e5e39fa63568d83f4f69ebd}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run custom csfle tests
- name: run-custom-csfle-tests-latest-master
tags:
- run-custom-dependency-tests
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: '16'}
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: latest}
- {key: TOPOLOGY, value: replica_set}
- {key: CSFLE_GIT_REF, value: master}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: install mongodb-client-encryption
- func: run custom csfle tests
- name: test-latest-driver-mongodb-client-encryption-6.0.0
tags:
Expand Down Expand Up @@ -4348,6 +4305,26 @@ tasks:
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: run tests
- name: run-custom-csfle-tests-with-libmongocrypt-latest
tags:
- run-custom-dependency-tests
- nightly
commands:
- command: expansions.update
type: setup
params:
updates:
- {key: NODE_LTS_VERSION, value: '16'}
- {key: NPM_VERSION, value: '9'}
- {key: VERSION, value: '8.0'}
- {key: TOPOLOGY, value: replica_set}
- func: install dependencies
- func: bootstrap mongo-orchestration
- func: bootstrap kms servers
- func: install mongodb-client-encryption
vars:
LIBMONGOCRYPT_VERSION: latest
- func: run custom csfle tests
task_groups:
- name: serverless_task_group
setup_group_can_fail_task: true
Expand Down Expand Up @@ -5118,12 +5095,9 @@ buildvariants:
display_name: Custom Dependency Version Test
run_on: rhel80-large
tasks:
- run-custom-csfle-tests-5.0-pinned-commit
- run-custom-csfle-tests-5.0-master
- run-custom-csfle-tests-rapid-pinned-commit
- run-custom-csfle-tests-rapid-master
- run-custom-csfle-tests-latest-pinned-commit
- run-custom-csfle-tests-latest-master
- run-custom-csfle-tests-5.0
- run-custom-csfle-tests-rapid
- run-custom-csfle-tests-latest
- test-latest-driver-mongodb-client-encryption-6.0.0
- name: rhel8-test-serverless
display_name: Serverless Test
Expand Down
49 changes: 23 additions & 26 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -579,33 +579,29 @@ BUILD_VARIANTS.push({
tasks: ['test-atlas-data-lake']
});

const oneOffFuncAsTasks = [];

const FLE_PINNED_COMMIT = '974a4614f8c1c3786e5e39fa63568d83f4f69ebd';
aditi-khare-mongoDB marked this conversation as resolved.
Show resolved Hide resolved
const customDependencyTests = [];

for (const version of ['5.0', 'rapid', 'latest']) {
for (const ref of [FLE_PINNED_COMMIT, 'master']) {
oneOffFuncAsTasks.push({
name: `run-custom-csfle-tests-${version}-${ref === 'master' ? ref : 'pinned-commit'}`,
tags: ['run-custom-dependency-tests'],
commands: [
updateExpansions({
NODE_LTS_VERSION: LOWEST_LTS,
NPM_VERSION: 9,
VERSION: version,
TOPOLOGY: 'replica_set',
CSFLE_GIT_REF: ref
}),
{ func: 'install dependencies' },
{ func: 'bootstrap mongo-orchestration' },
{ func: 'bootstrap kms servers' },
{ func: 'run custom csfle tests' }
]
});
}
customDependencyTests.push({
name: `run-custom-csfle-tests-${version}`,
tags: ['run-custom-dependency-tests'],
commands: [
updateExpansions({
NODE_LTS_VERSION: LOWEST_LTS,
NPM_VERSION: 9,
VERSION: version,
TOPOLOGY: 'replica_set',
}),
{ func: 'install dependencies' },
{ func: 'bootstrap mongo-orchestration' },
{ func: 'bootstrap kms servers' },
{ func: 'install mongodb-client-encryption' },
{ func: 'run custom csfle tests' }
]
});
}

oneOffFuncAsTasks.push({
customDependencyTests.push({
name: `test-latest-driver-mongodb-client-encryption-6.0.0`,
tags: ['run-custom-dependency-tests'],
commands: [
Expand Down Expand Up @@ -641,13 +637,13 @@ const coverageTask = {
};

SINGLETON_TASKS.push(coverageTask);
SINGLETON_TASKS.push(...oneOffFuncAsTasks);
SINGLETON_TASKS.push(...customDependencyTests);

BUILD_VARIANTS.push({
name: 'rhel8-custom-dependency-tests',
display_name: 'Custom Dependency Version Test',
run_on: DEFAULT_OS,
tasks: oneOffFuncAsTasks.map(({ name }) => name)
tasks: customDependencyTests.map(({ name }) => name)
});

// special case for serverless testing
Expand Down Expand Up @@ -758,7 +754,8 @@ fileData.tasks = (fileData.tasks || [])
.concat(SINGLETON_TASKS)
.concat(AUTH_DISABLED_TASKS)
.concat(AWS_LAMBDA_HANDLER_TASKS)
.concat(MONGOCRYPTD_CSFLE_TASKS);
.concat(MONGOCRYPTD_CSFLE_TASKS)
.concat(NIGHTLY_TASKS);
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved

fileData.buildvariants = (fileData.buildvariants || []).concat(BUILD_VARIANTS);

Expand Down
33 changes: 33 additions & 0 deletions .evergreen/install-mongodb-client-encryption.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /usr/bin/env bash
set +o xtrace # Do not write AWS credentials to stderr

# Initiail checks for running these tests
if [ -z ${INSTALL_DIR+omitted} ]; then echo "INSTALL_DIR is unset" && exit 1; fi
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
if [ -z ${PROJECT_DIRECTORY+omitted} ]; then echo "PROJECT_DIRECTORY is unset" && exit 1; fi

source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"

set -o xtrace # Write all commands first to stderr
set -o errexit # Exit the script with error if any of the commands fail

CWD=$(pwd)

rm -rf $INSTALL_DIR
git clone https://github.com/mongodb-js/mongodb-client-encryption.git $INSTALL_DIR
cd $INSTALL_DIR
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved

if [ -n "${LIBMONGOCRYPT_VERSION}" ]; then
# nightly tests test with `latest` to test against the laster FLE build.
npm run install:libmongocrypt -- --libVersion $LIBMONGOCRYPT_VERSION
else
# otherwise use whatever is specified in the package.json.
npm run install:libmongocrypt
fi

echo "finished installing libmongocrypt"
BINDINGS_DIR=$(pwd)

cd $CWD
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved

echo "linking mongodb-client-encrytion"
npm link $BINDINGS_DIR
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
42 changes: 0 additions & 42 deletions .evergreen/run-custom-csfle-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,48 +22,6 @@ echo "adding temporary AWS credentials to environment"
# CSFLE_AWS_TEMP_ACCESS_KEY_ID, CSFLE_AWS_TEMP_SECRET_ACCESS_KEY, CSFLE_AWS_TEMP_SESSION_TOKEN
. "$DRIVERS_TOOLS"/.evergreen/csfle/set-temp-creds.sh

ABS_PATH_TO_PATCH=$(pwd)

# Environment Variables:
# CSFLE_GIT_REF - set the git reference to checkout for a custom CSFLE version
# CDRIVER_GIT_REF - set the git reference to checkout for a custom CDRIVER version (this is for libbson)
CSFLE_GIT_REF=${CSFLE_GIT_REF:-master}
CDRIVER_GIT_REF=${CDRIVER_GIT_REF:-1.17.6}

rm -rf ../csfle-deps-tmp
mkdir -p ../csfle-deps-tmp
pushd ../csfle-deps-tmp

rm -rf libmongocrypt mongo-c-driver

git clone https://github.com/mongodb/libmongocrypt.git
pushd libmongocrypt
git fetch --tags
git checkout "$CSFLE_GIT_REF" -b csfle-custom
echo "checked out libmongocrypt at $(git rev-parse HEAD)"
popd # libmongocrypt

git clone https://github.com/mongodb/mongo-c-driver.git
pushd mongo-c-driver
git fetch --tags
git checkout "$CDRIVER_GIT_REF" -b cdriver-custom
echo "checked out C driver at $(git rev-parse HEAD)"
popd # mongo-c-driver

pushd libmongocrypt/bindings/node

npm install --production --ignore-scripts
bash ./etc/build-static.sh

npm run rebuild # just in case this is necessary?

BINDINGS_DIR=$(pwd)
popd # libmongocrypt/bindings/node
popd # ../csfle-deps-tmp

# copy mongodb-client-encryption into driver's node_modules
npm link $BINDINGS_DIR

export MONGODB_URI=${MONGODB_URI}
export KMIP_TLS_CA_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/ca.pem"
export KMIP_TLS_CERT_FILE="${DRIVERS_TOOLS}/.evergreen/x509gen/client.pem"
Expand Down
Loading