Skip to content

Commit 24e5705

Browse files
RaschidJFRtadjik1
andauthored
chore(NODE-7512): add Windows Node Latest to smoke test configuration (#4940)
Co-authored-by: Sergey Zelenov <sergey.zelenov@mongodb.com>
1 parent 90f6967 commit 24e5705

4 files changed

Lines changed: 79 additions & 6 deletions

File tree

.evergreen/config.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3687,7 +3687,8 @@ buildvariants:
36873687
run_on: rhel80-large
36883688
expansions:
36893689
NODE_LTS_VERSION: latest
3690-
CLIENT_ENCRYPTION: true
3690+
CLIENT_ENCRYPTION: 'true'
3691+
TEST_CSFLE: 'true'
36913692
tasks:
36923693
- test-latest-server
36933694
- test-latest-replica_set
@@ -3868,6 +3869,49 @@ buildvariants:
38683869
- test-tls-support-5.0
38693870
- test-tls-support-4.4
38703871
- test-tls-support-4.2
3872+
- name: windows-2022-latest-large-node-latest
3873+
display_name: Windows Node Latest
3874+
run_on: windows-2022-latest-large
3875+
expansions:
3876+
NODE_LTS_VERSION: latest
3877+
CLIENT_ENCRYPTION: 'false'
3878+
TEST_CSFLE: 'false'
3879+
tasks:
3880+
- test-latest-server
3881+
- test-latest-replica_set
3882+
- test-latest-sharded_cluster
3883+
- test-rapid-server
3884+
- test-rapid-replica_set
3885+
- test-rapid-sharded_cluster
3886+
- test-8.0-server
3887+
- test-8.0-replica_set
3888+
- test-8.0-sharded_cluster
3889+
- test-7.0-server
3890+
- test-7.0-replica_set
3891+
- test-7.0-sharded_cluster
3892+
- test-6.0-server
3893+
- test-6.0-replica_set
3894+
- test-6.0-sharded_cluster
3895+
- test-5.0-server
3896+
- test-5.0-replica_set
3897+
- test-5.0-sharded_cluster
3898+
- test-4.4-server
3899+
- test-4.4-replica_set
3900+
- test-4.4-sharded_cluster
3901+
- test-4.2-server
3902+
- test-4.2-replica_set
3903+
- test-4.2-sharded_cluster
3904+
- test-latest-server-v1-api
3905+
- test-socks5-tls
3906+
- test-snappy-compression
3907+
- test-zstd-compression
3908+
- test-tls-support-latest
3909+
- test-tls-support-8.0
3910+
- test-tls-support-7.0
3911+
- test-tls-support-6.0
3912+
- test-tls-support-5.0
3913+
- test-tls-support-4.4
3914+
- test-tls-support-4.2
38713915
- name: rhel8-node20.19.0-test-csfle-mongocryptd
38723916
display_name: rhel 8 Node20.19.0 test mongocryptd
38733917
run_on: rhel80-large

.evergreen/generate_evergreen_tasks.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,19 @@ for (const {
418418
BUILD_VARIANTS.push({ name, display_name, run_on, expansions, tasks: taskNames });
419419
}
420420

421-
const configureLatestNodeSmokeTest = os.match(/^rhel/);
421+
const configureLatestNodeSmokeTest = os.match(/^(rhel|windows)/);
422422
if (configureLatestNodeSmokeTest) {
423423
const buildVariantData = {
424424
name: `${osName}-node-latest`,
425425
display_name: `${osDisplayName} Node Latest`,
426426
run_on,
427-
expansions: { NODE_LTS_VERSION: 'latest' },
427+
expansions: {
428+
NODE_LTS_VERSION: 'latest',
429+
CLIENT_ENCRYPTION: String(!!clientEncryption),
430+
TEST_CSFLE: String(!!clientEncryption)
431+
},
428432
tasks: tasks.map(({ name }) => name)
429433
};
430-
if (clientEncryption) {
431-
buildVariantData.expansions.CLIENT_ENCRYPTION = true;
432-
}
433434
BUILD_VARIANTS.push(buildVariantData);
434435
}
435436
}

.evergreen/install-dependencies.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ if [ -z ${NODE_LTS_VERSION+omitted} ]; then echo "NODE_LTS_VERSION is unset" &&
1212
# be handled by this script in drivers tools.
1313
source $DRIVERS_TOOLS/.evergreen/install-node.sh
1414

15+
# On Windows, install-node.sh resolves SCRIPT_DIR via realpath which may follow an NTFS
16+
# junction (e.g. C: -> Z:), so NODE_ARTIFACTS_PATH is now correctly set to the real drive.
17+
# Persist it to .env so that subsequent shells (e.g. run-tests.sh) can recover it even
18+
# when they call init-node-and-npm-env.sh via the C: DRIVERS_TOOLS path.
19+
if [ "${OS:-}" = "Windows_NT" ] && [ -n "${NODE_ARTIFACTS_PATH:-}" ]; then
20+
echo "NODE_ARTIFACTS_PATH=${NODE_ARTIFACTS_PATH}" >> "${DRIVERS_TOOLS}/.env"
21+
fi
22+
_INSTALL_DEPS_NODE_ARTIFACTS_PATH="${NODE_ARTIFACTS_PATH:-}"
23+
1524
if [ "$NATIVE" = "true" ]; then
1625
# https://github.com/nodejs/node-gyp#configuring-python-dependency
1726
. $DRIVERS_TOOLS/.evergreen/find-python3.sh
@@ -22,3 +31,10 @@ fi
2231
npm install "${NPM_OPTIONS}"
2332

2433
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
34+
# On Windows, the init call above may have overwritten NODE_ARTIFACTS_PATH with the wrong
35+
# drive letter. Restore the previously resolved path if npm is no longer accessible.
36+
if [ "${OS:-}" = "Windows_NT" ] && [ -n "$_INSTALL_DEPS_NODE_ARTIFACTS_PATH" ] && ! command -v npm >/dev/null 2>&1; then
37+
export NODE_ARTIFACTS_PATH="$_INSTALL_DEPS_NODE_ARTIFACTS_PATH"
38+
export PATH="$NODE_ARTIFACTS_PATH/nodejs/bin:$PATH"
39+
hash -r
40+
fi

.evergreen/run-tests.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,19 @@ echo "Running $AUTH tests over $SSL, connecting to $MONGODB_URI"
3636
if [[ -z "${SKIP_DEPS}" ]]; then
3737
source "${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
3838
else
39+
# On Windows, DRIVERS_TOOLS is a C: path but Node may have been installed on Z: (NTFS
40+
# junction). Load NODE_ARTIFACTS_PATH written by install-dependencies.sh before calling
41+
# init so we can restore it if init resolves to the wrong drive.
42+
_RUN_TESTS_SAVED_NODE_PATH=""
43+
if [ "${OS:-}" = "Windows_NT" ] && [ -f "${DRIVERS_TOOLS}/.env" ]; then
44+
_RUN_TESTS_SAVED_NODE_PATH=$(grep '^NODE_ARTIFACTS_PATH=' "${DRIVERS_TOOLS}/.env" | tail -1 | cut -d= -f2-)
45+
fi
3946
source $DRIVERS_TOOLS/.evergreen/init-node-and-npm-env.sh
47+
if [ "${OS:-}" = "Windows_NT" ] && [ -n "$_RUN_TESTS_SAVED_NODE_PATH" ] && ! command -v npm >/dev/null 2>&1; then
48+
export NODE_ARTIFACTS_PATH="$_RUN_TESTS_SAVED_NODE_PATH"
49+
export PATH="$NODE_ARTIFACTS_PATH/nodejs/bin:$PATH"
50+
hash -r
51+
fi
4052
fi
4153

4254
if [ "$COMPRESSOR" != "" ]; then

0 commit comments

Comments
 (0)