From f2d476411054a43db3c8ba2105e17ac72d109d1c Mon Sep 17 00:00:00 2001 From: Warren James Date: Fri, 31 Jan 2025 16:24:02 -0500 Subject: [PATCH 1/5] unskip tests --- .evergreen/config.yml | 1 - .evergreen/generate_evergreen_tasks.js | 2 -- .mocharc.json => .mocharc.js | 11 ++++++-- package.json | 38 +++++++++++++------------- test/manual/mocharc.js | 13 +++++++++ test/manual/mocharc.json | 10 ------- test/mocha_lambda.js | 19 +++++++++++++ test/mocha_lambda.json | 14 ---------- test/mocha_mongodb.js | 34 +++++++++++++++++++++++ test/mocha_mongodb.json | 30 -------------------- 10 files changed, 93 insertions(+), 79 deletions(-) rename .mocharc.json => .mocharc.js (59%) create mode 100644 test/manual/mocharc.js delete mode 100644 test/manual/mocharc.json create mode 100644 test/mocha_lambda.js delete mode 100644 test/mocha_lambda.json create mode 100644 test/mocha_mongodb.js delete mode 100644 test/mocha_mongodb.json diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 0950cf6403e..2a029abdc07 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -4468,7 +4468,6 @@ buildvariants: - test-tls-support-5.0 - test-tls-support-4.4 - test-tls-support-4.2 - disable: true - name: windows-vsCurrent-large-gallium display_name: Windows Node16 run_on: windows-vsCurrent-large diff --git a/.evergreen/generate_evergreen_tasks.js b/.evergreen/generate_evergreen_tasks.js index e28f74f1d2f..c885865e344 100644 --- a/.evergreen/generate_evergreen_tasks.js +++ b/.evergreen/generate_evergreen_tasks.js @@ -442,8 +442,6 @@ for (const { run_on, expansions: { NODE_LTS_VERSION: 'latest' }, tasks: tasks.map(({ name }) => name), - // TODO(NODE-6641): Unskip the smoke tests - disable: true }; if (clientEncryption) { buildVariantData.expansions.CLIENT_ENCRYPTION = true; diff --git a/.mocharc.json b/.mocharc.js similarity index 59% rename from .mocharc.json rename to .mocharc.js index eae1c0b935e..2a3511a0bbe 100644 --- a/.mocharc.json +++ b/.mocharc.js @@ -1,5 +1,9 @@ -{ - "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json", +'use strict'; + +const [major] = process.versions.node.split('.'); + +/** @type {import("mocha").MochaOptions} */ +module.exports = { "require": [ "source-map-support/register", "ts-node/register", @@ -15,5 +19,6 @@ "failZero": true, "reporter": "test/tools/reporter/mongodb_reporter.js", "sort": true, - "color": true + "color": true, + "node-option": Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined } diff --git a/package.json b/package.json index 54d367ae774..90c03767498 100644 --- a/package.json +++ b/package.json @@ -132,32 +132,32 @@ "check:bench": "npm --prefix test/benchmarks/driver_bench start", "check:coverage": "nyc npm run test:all", "check:integration-coverage": "nyc npm run check:test", - "check:lambda": "mocha --config test/mocha_lambda.json test/integration/node-specific/examples/handler.test.js", - "check:lambda:aws": "mocha --config test/mocha_lambda.json test/integration/node-specific/examples/aws_handler.test.js", + "check:lambda": "mocha --config test/mocha_lambda.js test/integration/node-specific/examples/handler.test.js", + "check:lambda:aws": "mocha --config test/mocha_lambda.js test/integration/node-specific/examples/aws_handler.test.js", "check:lint": "npm run build:dts && npm run check:dts && npm run check:eslint && npm run check:tsd", "check:eslint": "npm run build:dts && ESLINT_USE_FLAT_CONFIG=false eslint -v && ESLINT_USE_FLAT_CONFIG=false eslint --max-warnings=0 --ext '.js,.ts' src test", "check:tsd": "tsd --version && tsd", "check:dependencies": "mocha test/action/dependency.test.ts", "check:dts": "node ./node_modules/typescript/bin/tsc --noEmit mongodb.d.ts && tsd", - "check:search-indexes": "nyc mocha --config test/mocha_mongodb.json test/manual/search-index-management.prose.test.ts", - "check:test": "mocha --config test/mocha_mongodb.json test/integration", + "check:search-indexes": "nyc mocha --config test/mocha_mongodb.js test/manual/search-index-management.prose.test.ts", + "check:test": "mocha --config test/mocha_mongodb.js test/integration", "check:unit": "mocha test/unit", "check:ts": "node ./node_modules/typescript/bin/tsc -v && node ./node_modules/typescript/bin/tsc --noEmit", - "check:atlas": "mocha --config test/manual/mocharc.json test/manual/atlas_connectivity.test.ts", - "check:resource-management": "mocha --config test/manual/mocharc.json test/manual/resource_management.test.ts", - "check:drivers-atlas-testing": "mocha --config test/mocha_mongodb.json test/atlas/drivers_atlas_testing.test.ts", - "check:adl": "mocha --config test/mocha_mongodb.json test/manual/atlas-data-lake-testing", - "check:aws": "nyc mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_aws.test.ts", - "check:oidc-auth": "mocha --config test/mocha_mongodb.json test/integration/auth/auth.spec.test.ts", - "check:oidc-test": "mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc.prose.test.ts", - "check:oidc-azure": "mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_azure.prose.05.test.ts", - "check:oidc-gcp": "mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts", - "check:oidc-k8s": "mocha --config test/mocha_mongodb.json test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts", - "check:kerberos": "nyc mocha --config test/manual/mocharc.json test/manual/kerberos.test.ts", - "check:tls": "mocha --config test/manual/mocharc.json test/manual/tls_support.test.ts", - "check:ldap": "nyc mocha --config test/manual/mocharc.json test/manual/ldap.test.ts", - "check:socks5": "mocha --config test/manual/mocharc.json test/manual/socks5.test.ts", - "check:csfle": "mocha --config test/mocha_mongodb.json test/integration/client-side-encryption", + "check:atlas": "mocha --config test/manual/mocharc.js test/manual/atlas_connectivity.test.ts", + "check:resource-management": "mocha --config test/manual/mocharc.js test/manual/resource_management.test.ts", + "check:drivers-atlas-testing": "mocha --config test/mocha_mongodb.js test/atlas/drivers_atlas_testing.test.ts", + "check:adl": "mocha --config test/mocha_mongodb.js test/manual/atlas-data-lake-testing", + "check:aws": "nyc mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_aws.test.ts", + "check:oidc-auth": "mocha --config test/mocha_mongodb.js test/integration/auth/auth.spec.test.ts", + "check:oidc-test": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc.prose.test.ts", + "check:oidc-azure": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_azure.prose.05.test.ts", + "check:oidc-gcp": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_gcp.prose.06.test.ts", + "check:oidc-k8s": "mocha --config test/mocha_mongodb.js test/integration/auth/mongodb_oidc_k8s.prose.07.test.ts", + "check:kerberos": "nyc mocha --config test/manual/mocharc.js test/manual/kerberos.test.ts", + "check:tls": "mocha --config test/manual/mocharc.js test/manual/tls_support.test.ts", + "check:ldap": "nyc mocha --config test/manual/mocharc.js test/manual/ldap.test.ts", + "check:socks5": "mocha --config test/manual/mocharc.js test/manual/socks5.test.ts", + "check:csfle": "mocha --config test/mocha_mongodb.js test/integration/client-side-encryption", "check:snappy": "mocha test/unit/assorted/snappy.test.js", "check:x509": "mocha test/manual/x509_auth.test.ts", "fix:eslint": "npm run check:eslint -- --fix", diff --git a/test/manual/mocharc.js b/test/manual/mocharc.js new file mode 100644 index 00000000000..04c59052424 --- /dev/null +++ b/test/manual/mocharc.js @@ -0,0 +1,13 @@ +'use strict'; + +const [major] = process.versions.node.split('.'); + +/** @type {import("mocha").MochaOptions} */ +module.exports = { + require: ['ts-node/register', 'test/tools/runner/chai_addons.ts'], + reporter: 'test/tools/reporter/mongodb_reporter.js', + failZero: true, + color: true, + timeout: 10000, + 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined +}; diff --git a/test/manual/mocharc.json b/test/manual/mocharc.json deleted file mode 100644 index 08a1a88d8e8..00000000000 --- a/test/manual/mocharc.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "require": [ - "ts-node/register", - "test/tools/runner/chai_addons.ts" - ], - "reporter": "test/tools/reporter/mongodb_reporter.js", - "failZero": true, - "color": true, - "timeout": 10000 -} diff --git a/test/mocha_lambda.js b/test/mocha_lambda.js new file mode 100644 index 00000000000..1829fd6a0a3 --- /dev/null +++ b/test/mocha_lambda.js @@ -0,0 +1,19 @@ +'use strict'; + +const [major] = process.versions.node.split('.'); + +/** @type {import("mocha").MochaOptions} */ +module.exports = { + $schema: + 'https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json', + require: ['test/integration/node-specific/examples/setup.js'], + extension: ['js'], + ui: 'test/tools/runner/metadata_ui.js', + recursive: true, + timeout: 6000, + failZero: true, + reporter: 'test/tools/reporter/mongodb_reporter.js', + sort: true, + color: true, + 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined +}; diff --git a/test/mocha_lambda.json b/test/mocha_lambda.json deleted file mode 100644 index 53ec17874ee..00000000000 --- a/test/mocha_lambda.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json", - "require": [ - "test/integration/node-specific/examples/setup.js" - ], - "extension": ["js"], - "ui": "test/tools/runner/metadata_ui.js", - "recursive": true, - "timeout": 6000, - "failZero": true, - "reporter": "test/tools/reporter/mongodb_reporter.js", - "sort": true, - "color": true -} diff --git a/test/mocha_mongodb.js b/test/mocha_mongodb.js new file mode 100644 index 00000000000..7b98e1923f9 --- /dev/null +++ b/test/mocha_mongodb.js @@ -0,0 +1,34 @@ +'use strict'; + +const [major] = process.versions.node.split('.'); + +/** @type {import("mocha").MochaOptions} */ +module.exports = { + $schema: + 'https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json', + require: [ + 'source-map-support/register', + 'ts-node/register', + 'test/tools/runner/chai_addons.ts', + 'test/tools/runner/hooks/ee_checker.ts', + 'test/tools/runner/hooks/configuration.ts', + 'test/tools/runner/hooks/leak_checker.ts', + 'test/tools/runner/hooks/legacy_crud_shims.ts' + ], + extension: ['js', 'ts'], + ui: 'test/tools/runner/metadata_ui.js', + recursive: true, + timeout: 60000, + failZero: true, + reporter: 'test/tools/reporter/mongodb_reporter.js', + sort: true, + color: true, + ignore: [ + 'test/integration/node-specific/examples/handler.js', + 'test/integration/node-specific/examples/handler.test.js', + 'test/integration/node-specific/examples/aws_handler.js', + 'test/integration/node-specific/examples/aws_handler.test.js', + 'test/integration/node-specific/examples/setup.js' + ], + 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined +}; diff --git a/test/mocha_mongodb.json b/test/mocha_mongodb.json deleted file mode 100644 index bab33041991..00000000000 --- a/test/mocha_mongodb.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json", - "require": [ - "source-map-support/register", - "ts-node/register", - "test/tools/runner/ee_checker.ts", - "test/tools/runner/chai_addons.ts", - "test/tools/runner/hooks/configuration.ts", - "test/tools/runner/hooks/leak_checker.ts", - "test/tools/runner/hooks/legacy_crud_shims.ts" - ], - "extension": [ - "js", - "ts" - ], - "ui": "test/tools/runner/metadata_ui.js", - "recursive": true, - "timeout": 60000, - "failZero": true, - "reporter": "test/tools/reporter/mongodb_reporter.js", - "sort": true, - "color": true, - "ignore": [ - "test/integration/node-specific/examples/handler.js", - "test/integration/node-specific/examples/handler.test.js", - "test/integration/node-specific/examples/aws_handler.js", - "test/integration/node-specific/examples/aws_handler.test.js", - "test/integration/node-specific/examples/setup.js" - ] -} From 74e6bc6ad94068c1fc82bc40985dd6ca5edd0948 Mon Sep 17 00:00:00 2001 From: Warren James Date: Fri, 31 Jan 2025 16:30:23 -0500 Subject: [PATCH 2/5] format .mocharc.js --- .mocharc.js | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.mocharc.js b/.mocharc.js index 2a3511a0bbe..c4b65669c84 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -4,21 +4,18 @@ const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ module.exports = { - "require": [ + require: [ "source-map-support/register", "ts-node/register", "test/tools/runner/chai_addons.ts", "test/tools/runner/ee_checker.ts" ], - "extension": [ - "js", - "ts" - ], - "recursive": true, - "timeout": 60000, - "failZero": true, - "reporter": "test/tools/reporter/mongodb_reporter.js", - "sort": true, - "color": true, - "node-option": Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined -} + extension: ['js', 'ts'], + recursive: true, + timeout: 60000, + failZero: true, + reporter: 'test/tools/reporter/mongodb_reporter.js', + sort: true, + color: true, + 'node-option': Number(major) >= 23 ? ['no-experimental-strip-types'] : undefined +}; From 13ef59623399d5e299162e5780543f84a3bbd079 Mon Sep 17 00:00:00 2001 From: Warren James Date: Fri, 31 Jan 2025 16:32:50 -0500 Subject: [PATCH 3/5] remove schema entries --- test/mocha_lambda.js | 2 -- test/mocha_mongodb.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/test/mocha_lambda.js b/test/mocha_lambda.js index 1829fd6a0a3..cb1079aed33 100644 --- a/test/mocha_lambda.js +++ b/test/mocha_lambda.js @@ -4,8 +4,6 @@ const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ module.exports = { - $schema: - 'https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json', require: ['test/integration/node-specific/examples/setup.js'], extension: ['js'], ui: 'test/tools/runner/metadata_ui.js', diff --git a/test/mocha_mongodb.js b/test/mocha_mongodb.js index 7b98e1923f9..2c6755ae224 100644 --- a/test/mocha_mongodb.js +++ b/test/mocha_mongodb.js @@ -4,8 +4,6 @@ const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ module.exports = { - $schema: - 'https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/mocharc.json', require: [ 'source-map-support/register', 'ts-node/register', From 549c64d208448fd4a92b6a6b244fa26d615dd04c Mon Sep 17 00:00:00 2001 From: Warren James Date: Tue, 4 Feb 2025 16:14:16 -0500 Subject: [PATCH 4/5] update path --- .evergreen/run-azure-kms-tests.sh | 2 +- .evergreen/run-gcp-kms-tests.sh | 2 +- .evergreen/run-serverless-tests.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.evergreen/run-azure-kms-tests.sh b/.evergreen/run-azure-kms-tests.sh index 3168f7b0bb3..c8818962d48 100644 --- a/.evergreen/run-azure-kms-tests.sh +++ b/.evergreen/run-azure-kms-tests.sh @@ -18,4 +18,4 @@ export MONGODB_URI="mongodb://localhost:27017" export EXPECTED_AZUREKMS_OUTCOME=${EXPECTED_AZUREKMS_OUTCOME:-omitted} export TEST_CSFLE=true -npx mocha --config test/mocha_mongodb.json test/integration/client-side-encryption/client_side_encryption.prose.19.on_demand_azure.test.ts +npx mocha --config test/mocha_mongodb.js test/integration/client-side-encryption/client_side_encryption.prose.19.on_demand_azure.test.ts diff --git a/.evergreen/run-gcp-kms-tests.sh b/.evergreen/run-gcp-kms-tests.sh index 3f932681ea3..ecc88e535e3 100644 --- a/.evergreen/run-gcp-kms-tests.sh +++ b/.evergreen/run-gcp-kms-tests.sh @@ -20,4 +20,4 @@ export MONGODB_URI="mongodb://localhost:27017" export EXPECTED_GCPKMS_OUTCOME=${EXPECTED_GCPKMS_OUTCOME:-omitted} export TEST_CSFLE=true -npx mocha --config test/mocha_mongodb.json test/integration/client-side-encryption/client_side_encryption.prose.17.on_demand_gcp.test.ts +npx mocha --config test/mocha_mongodb.js test/integration/client-side-encryption/client_side_encryption.prose.17.on_demand_gcp.test.ts diff --git a/.evergreen/run-serverless-tests.sh b/.evergreen/run-serverless-tests.sh index b134fd4be66..1799b34db30 100755 --- a/.evergreen/run-serverless-tests.sh +++ b/.evergreen/run-serverless-tests.sh @@ -17,7 +17,7 @@ if [ -z ${SERVERLESS_ATLAS_USER+omitted} ]; then echo "SERVERLESS_ATLAS_USER is if [ -z ${SERVERLESS_ATLAS_PASSWORD+omitted} ]; then echo "SERVERLESS_ATLAS_PASSWORD is unset" && exit 1; fi npx mocha \ - --config test/mocha_mongodb.json \ + --config test/mocha_mongodb.js \ test/integration/crud/crud.spec.test.ts \ test/integration/crud/crud.prose.test.ts \ test/integration/retryable-reads/retryable_reads.spec.test.ts \ From 619c168b1245d5e067201e45eafc1cb7190266f0 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Wed, 12 Feb 2025 15:11:17 -0500 Subject: [PATCH 5/5] rebase fixes --- .mocharc.js | 8 ++++---- test/mocha_mongodb.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.mocharc.js b/.mocharc.js index c4b65669c84..a289ec1a9de 100644 --- a/.mocharc.js +++ b/.mocharc.js @@ -5,10 +5,10 @@ const [major] = process.versions.node.split('.'); /** @type {import("mocha").MochaOptions} */ module.exports = { require: [ - "source-map-support/register", - "ts-node/register", - "test/tools/runner/chai_addons.ts", - "test/tools/runner/ee_checker.ts" + 'source-map-support/register', + 'ts-node/register', + 'test/tools/runner/chai_addons.ts', + 'test/tools/runner/ee_checker.ts' ], extension: ['js', 'ts'], recursive: true, diff --git a/test/mocha_mongodb.js b/test/mocha_mongodb.js index 2c6755ae224..eeb18ae4f8d 100644 --- a/test/mocha_mongodb.js +++ b/test/mocha_mongodb.js @@ -8,7 +8,7 @@ module.exports = { 'source-map-support/register', 'ts-node/register', 'test/tools/runner/chai_addons.ts', - 'test/tools/runner/hooks/ee_checker.ts', + 'test/tools/runner/ee_checker.ts', 'test/tools/runner/hooks/configuration.ts', 'test/tools/runner/hooks/leak_checker.ts', 'test/tools/runner/hooks/legacy_crud_shims.ts'