Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
46 changes: 45 additions & 1 deletion .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3687,7 +3687,8 @@ buildvariants:
run_on: rhel80-large
expansions:
NODE_LTS_VERSION: latest
CLIENT_ENCRYPTION: true
CLIENT_ENCRYPTION: 'true'
TEST_CSFLE: 'true'
tasks:
- test-latest-server
- test-latest-replica_set
Expand Down Expand Up @@ -3868,6 +3869,49 @@ buildvariants:
- test-tls-support-5.0
- test-tls-support-4.4
- test-tls-support-4.2
- name: windows-2022-latest-large-node-latest
display_name: Windows Node Latest
run_on: windows-2022-latest-large
expansions:
NODE_LTS_VERSION: latest
CLIENT_ENCRYPTION: 'false'
TEST_CSFLE: 'false'
tasks:
- test-latest-server
- test-latest-replica_set
- test-latest-sharded_cluster
- test-rapid-server
- test-rapid-replica_set
- test-rapid-sharded_cluster
- test-8.0-server
- test-8.0-replica_set
- test-8.0-sharded_cluster
- test-7.0-server
- test-7.0-replica_set
- test-7.0-sharded_cluster
- test-6.0-server
- test-6.0-replica_set
- test-6.0-sharded_cluster
- test-5.0-server
- test-5.0-replica_set
- test-5.0-sharded_cluster
- test-4.4-server
- test-4.4-replica_set
- test-4.4-sharded_cluster
- test-4.2-server
- test-4.2-replica_set
- test-4.2-sharded_cluster
- test-latest-server-v1-api
- test-socks5-tls
- test-snappy-compression
- test-zstd-compression
- test-tls-support-latest
- test-tls-support-8.0
- test-tls-support-7.0
- test-tls-support-6.0
- test-tls-support-5.0
- test-tls-support-4.4
- test-tls-support-4.2
- name: rhel8-node20.19.0-test-csfle-mongocryptd
display_name: rhel 8 Node20.19.0 test mongocryptd
run_on: rhel80-large
Expand Down
11 changes: 6 additions & 5 deletions .evergreen/generate_evergreen_tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,18 +418,19 @@ for (const {
BUILD_VARIANTS.push({ name, display_name, run_on, expansions, tasks: taskNames });
}

const configureLatestNodeSmokeTest = os.match(/^rhel/);
const configureLatestNodeSmokeTest = os.match(/^(rhel|windows)/);
if (configureLatestNodeSmokeTest) {
const buildVariantData = {
name: `${osName}-node-latest`,
display_name: `${osDisplayName} Node Latest`,
run_on,
expansions: { NODE_LTS_VERSION: 'latest' },
expansions: {
NODE_LTS_VERSION: 'latest',
CLIENT_ENCRYPTION: String(!!clientEncryption),
TEST_CSFLE: String(!!clientEncryption)
},
tasks: tasks.map(({ name }) => name)
};
if (clientEncryption) {
buildVariantData.expansions.CLIENT_ENCRYPTION = true;
}
BUILD_VARIANTS.push(buildVariantData);
}
}
Expand Down
16 changes: 16 additions & 0 deletions .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ if [ -z ${NODE_LTS_VERSION+omitted} ]; then echo "NODE_LTS_VERSION is unset" &&
# be handled by this script in drivers tools.
source $DRIVERS_TOOLS/.evergreen/install-node.sh

# On Windows, install-node.sh resolves SCRIPT_DIR via realpath which may follow an NTFS
# junction (e.g. C: -> Z:), so NODE_ARTIFACTS_PATH is now correctly set to the real drive.
# Persist it to .env so that subsequent shells (e.g. run-tests.sh) can recover it even
# when they call init-node-and-npm-env.sh via the C: DRIVERS_TOOLS path.
if [ "${OS:-}" = "Windows_NT" ] && [ -n "${NODE_ARTIFACTS_PATH:-}" ]; then
echo "NODE_ARTIFACTS_PATH=${NODE_ARTIFACTS_PATH}" >> "${DRIVERS_TOOLS}/.env"
fi
_INSTALL_DEPS_NODE_ARTIFACTS_PATH="${NODE_ARTIFACTS_PATH:-}"

Comment on lines +15 to +23
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Strictly speaking this change is not covered by the ticket AC, however I've discovered that tests are flaky some particular windows hosts (like this one), so I decided to include fix here. Please let me know if you prefer more formal process of ticket->separate PR, otherwise I would update PR description and ticket AC.

if [ "$NATIVE" = "true" ]; then
# https://github.com/nodejs/node-gyp#configuring-python-dependency
. $DRIVERS_TOOLS/.evergreen/find-python3.sh
Expand All @@ -22,3 +31,10 @@ fi
npm install "${NPM_OPTIONS}"

source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
# On Windows, the init call above may have overwritten NODE_ARTIFACTS_PATH with the wrong
# drive letter. Restore the previously resolved path if npm is no longer accessible.
if [ "${OS:-}" = "Windows_NT" ] && [ -n "$_INSTALL_DEPS_NODE_ARTIFACTS_PATH" ] && ! command -v npm >/dev/null 2>&1; then
export NODE_ARTIFACTS_PATH="$_INSTALL_DEPS_NODE_ARTIFACTS_PATH"
export PATH="$NODE_ARTIFACTS_PATH/nodejs/bin:$PATH"
hash -r
fi
12 changes: 12 additions & 0 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,19 @@ echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI"
if [[ -z "${SKIP_DEPS}" ]]; then
source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
else
# On Windows, DRIVERS_TOOLS is a C: path but Node may have been installed on Z: (NTFS
# junction). Load NODE_ARTIFACTS_PATH written by install-dependencies.sh before calling
# init so we can restore it if init resolves to the wrong drive.
_RUN_TESTS_SAVED_NODE_PATH=""
if [ "${OS:-}" = "Windows_NT" ] && [ -f "${DRIVERS_TOOLS}/.env" ]; then
_RUN_TESTS_SAVED_NODE_PATH=$(grep '^NODE_ARTIFACTS_PATH=' "${DRIVERS_TOOLS}/.env" | tail -1 | cut -d= -f2-)
fi
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
if [ "${OS:-}" = "Windows_NT" ] && [ -n "$_RUN_TESTS_SAVED_NODE_PATH" ] && ! command -v npm >/dev/null 2>&1; then
export NODE_ARTIFACTS_PATH="$_RUN_TESTS_SAVED_NODE_PATH"
export PATH="$NODE_ARTIFACTS_PATH/nodejs/bin:$PATH"
hash -r
fi
fi

if [ "$COMPRESSOR" != "" ]; then
Expand Down
Loading