diff --git a/.evergreen/.prettierrc.json b/.evergreen/.prettierrc.json new file mode 100644 index 0000000000..dfae21d047 --- /dev/null +++ b/.evergreen/.prettierrc.json @@ -0,0 +1 @@ +"@mongodb-js/prettier-config-devtools" diff --git a/.evergreen/build-variants/compile-build-variants.d.ts b/.evergreen/build-variants/compile-build-variants.d.ts index 1d0c853f8b..9299a28e7a 100644 --- a/.evergreen/build-variants/compile-build-variants.d.ts +++ b/.evergreen/build-variants/compile-build-variants.d.ts @@ -1,4 +1,4 @@ -export type CompileBuildVariantDefinition = { +export type CompileBuildVariant = { name: string; displayName: string; runOn: string; @@ -6,3 +6,5 @@ export type CompileBuildVariantDefinition = { id?: string; sharedOpenSsl?: string; }; + +export const COMPILE_BUILD_VARIANTS: CompileBuildVariant[]; diff --git a/.evergreen/build-variants/compile-build-variants.js b/.evergreen/build-variants/compile-build-variants.js index fbdeb991e2..4645485014 100644 --- a/.evergreen/build-variants/compile-build-variants.js +++ b/.evergreen/build-variants/compile-build-variants.js @@ -1,98 +1,98 @@ // @ts-check -/** @type {(import("./compile-build-variants").CompileBuildVariantDefinition)[]} */ +/** @type {import("./compile-build-variants").CompileBuildVariant[]} */ exports.COMPILE_BUILD_VARIANTS = [ { - displayName: "RHEL 7.0 x64", - runOn: "rhel70-build", - executableOsId: "linux-x64", + displayName: 'RHEL 7.0 x64', + runOn: 'rhel70-build', + executableOsId: 'linux-x64', }, { - displayName: "RHEL 8.0 x64", - runOn: "rhel80-build", - id: "linux_x64_rhel8", - executableOsId: "linux-x64", + displayName: 'RHEL 8.0 x64', + runOn: 'rhel80-build', + id: 'linux_x64_rhel8', + executableOsId: 'linux-x64', }, { - displayName: "RHEL 7.0 x64", - runOn: "rhel70-build", - executableOsId: "linux-x64-openssl11", - sharedOpenSsl: "openssl11", + displayName: 'RHEL 7.0 x64', + runOn: 'rhel70-build', + executableOsId: 'linux-x64-openssl11', + sharedOpenSsl: 'openssl11', }, { - displayName: "RHEL 8.0 x64", - runOn: "rhel80-build", - id: "linux_x64_openssl11_rhel8", - executableOsId: "linux-x64-openssl11", - sharedOpenSsl: "openssl11", + displayName: 'RHEL 8.0 x64', + runOn: 'rhel80-build', + id: 'linux_x64_openssl11_rhel8', + executableOsId: 'linux-x64-openssl11', + sharedOpenSsl: 'openssl11', }, { - displayName: "RHEL 7.0 x64", - runOn: "rhel70-build", - executableOsId: "linux-x64-openssl3", - sharedOpenSsl: "openssl3", + displayName: 'RHEL 7.0 x64', + runOn: 'rhel70-build', + executableOsId: 'linux-x64-openssl3', + sharedOpenSsl: 'openssl3', }, { - displayName: "RHEL 8.0 x64", - runOn: "rhel80-build", - id: "linux_x64_openssl3_rhel8", - executableOsId: "linux-x64-openssl3", - sharedOpenSsl: "openssl3", + displayName: 'RHEL 8.0 x64', + runOn: 'rhel80-build', + id: 'linux_x64_openssl3_rhel8', + executableOsId: 'linux-x64-openssl3', + sharedOpenSsl: 'openssl3', }, { - displayName: "Amazon 2 arm64", - runOn: "amazon2-arm64-large", - executableOsId: "linux-arm64", + displayName: 'Amazon 2 arm64', + runOn: 'amazon2-arm64-large', + executableOsId: 'linux-arm64', }, { - displayName: "Amazon 2 arm64", - runOn: "amazon2-arm64-large", - executableOsId: "linux-arm64-openssl11", - sharedOpenSsl: "openssl11", + displayName: 'Amazon 2 arm64', + runOn: 'amazon2-arm64-large', + executableOsId: 'linux-arm64-openssl11', + sharedOpenSsl: 'openssl11', }, { - displayName: "Amazon 2 arm64", - runOn: "amazon2-arm64-large", - executableOsId: "linux-arm64-openssl3", - sharedOpenSsl: "openssl3", + displayName: 'Amazon 2 arm64', + runOn: 'amazon2-arm64-large', + executableOsId: 'linux-arm64-openssl3', + sharedOpenSsl: 'openssl3', }, { - displayName: "RHEL 8 PPC", - runOn: "rhel8-power-small", - executableOsId: "linux-ppc64le", + displayName: 'RHEL 8 PPC', + runOn: 'rhel8-power-small', + executableOsId: 'linux-ppc64le', }, { - displayName: "RHEL 7 s390x", - runOn: "rhel7-zseries-large", - executableOsId: "linux-s390x", + displayName: 'RHEL 7 s390x', + runOn: 'rhel7-zseries-large', + executableOsId: 'linux-s390x', }, { - displayName: "MacOS Big Sur", - id: "darwin", - runOn: "macos-11", - executableOsId: "darwin-x64", + displayName: 'MacOS Big Sur', + id: 'darwin', + runOn: 'macos-11', + executableOsId: 'darwin-x64', }, { - displayName: "MacOS Big Sur arm64", - runOn: "macos-11-arm64", - executableOsId: "darwin-arm64", + displayName: 'MacOS Big Sur arm64', + runOn: 'macos-11-arm64', + executableOsId: 'darwin-arm64', }, { - id: "win32", - displayName: "Windows VS 2022", - runOn: "windows-vsCurrent-large", - executableOsId: "win32", + id: 'win32', + displayName: 'Windows VS 2022', + runOn: 'windows-vsCurrent-large', + executableOsId: 'win32', }, ].map((buildVariant) => { const { displayName, sharedOpenSsl, id, executableOsId } = buildVariant; - const formattedDisplayName = [displayName, sharedOpenSsl, "(Build)"] + const formattedDisplayName = [displayName, sharedOpenSsl, '(Build)'] .filter((text) => text) - .join(" "); + .join(' '); return { ...buildVariant, id, displayName: formattedDisplayName, - name: `build_${id ?? executableOsId.replaceAll("-", "_")}`, + name: `build_${id ?? executableOsId.replaceAll('-', '_')}`, }; }); diff --git a/.evergreen/build-variants/e2e-tests-build-variants.d.ts b/.evergreen/build-variants/e2e-tests-build-variants.d.ts index 8a877de57e..59b215bc5f 100644 --- a/.evergreen/build-variants/e2e-tests-build-variants.d.ts +++ b/.evergreen/build-variants/e2e-tests-build-variants.d.ts @@ -1,4 +1,4 @@ -export type E2ETestsBuildVariantDefinition = { +export type E2ETestsBuildVariant = { displayName: string; name: string; compileBuildVariant: string; @@ -10,3 +10,5 @@ export type E2ETestsBuildVariantDefinition = { fips?: boolean; additionalTasks?: string[]; }; + +export const E2E_TESTS_BUILD_VARIANTS: E2ETestsBuildVariant[]; diff --git a/.evergreen/build-variants/e2e-tests-build-variants.js b/.evergreen/build-variants/e2e-tests-build-variants.js index c44d090dab..3083de878b 100644 --- a/.evergreen/build-variants/e2e-tests-build-variants.js +++ b/.evergreen/build-variants/e2e-tests-build-variants.js @@ -1,383 +1,382 @@ -const { COMPILE_BUILD_VARIANTS } = require("./compile-build-variants.js"); +// @ts-check +const { COMPILE_BUILD_VARIANTS } = require('./compile-build-variants'); -//@ts-check - -/** @type {(import("./e2e-tests-build-variants.js").E2ETestsBuildVariantDefinition)[]} */ +/** @type {import("./e2e-tests-build-variants.js").E2ETestsBuildVariant[]} */ exports.E2E_TESTS_BUILD_VARIANTS = [ { - displayName: "RHEL 7.0 x64", - runOn: "rhel70-large", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "7.0.x", + displayName: 'RHEL 7.0 x64', + runOn: 'rhel70-large', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '7.0.x', }, { - displayName: "RHEL 7.6 x64", - runOn: "rhel76-large", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "7.0.x", + displayName: 'RHEL 7.6 x64', + runOn: 'rhel76-large', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '7.0.x', }, { - displayName: "RHEL 8.0 x64", - runOn: "rhel80-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'RHEL 8.0 x64', + runOn: 'rhel80-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "RHEL 9.0 x64", - runOn: "rhel90-small", - tags: ["nightly-driver"], + displayName: 'RHEL 9.0 x64', + runOn: 'rhel90-small', + tags: ['nightly-driver'], disableOpenSslSharedConfig: true, - executableOsId: "linux-x64", - mVersion: "7.0.x", + executableOsId: 'linux-x64', + mVersion: '7.0.x', }, { - displayName: "RHEL 9.3 x64", - runOn: "rhel93-small", - tags: ["nightly-driver"], + displayName: 'RHEL 9.3 x64', + runOn: 'rhel93-small', + tags: ['nightly-driver'], disableOpenSslSharedConfig: true, - executableOsId: "linux-x64", - mVersion: "stable", + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "RHEL 8.3 x64", - runOn: "rhel83-fips", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'RHEL 8.3 x64', + runOn: 'rhel83-fips', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "RHEL 8.3 x64", - runOn: "rhel83-fips", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl11", - executableOsId: "linux-x64-openssl11", - mVersion: "stable", + displayName: 'RHEL 8.3 x64', + runOn: 'rhel83-fips', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl11', + executableOsId: 'linux-x64-openssl11', + mVersion: 'stable', }, { - displayName: "RHEL 8.3 x64", - runOn: "rhel83-fips", - tags: ["nightly-driver"], + displayName: 'RHEL 8.3 x64', + runOn: 'rhel83-fips', + tags: ['nightly-driver'], fips: true, - sharedOpenSsl: "openssl11", - executableOsId: "linux-x64-openssl11", - mVersion: "stable", + sharedOpenSsl: 'openssl11', + executableOsId: 'linux-x64-openssl11', + mVersion: 'stable', }, { - displayName: "RHEL 9.3 x64", - runOn: "rhel93-fips", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'RHEL 9.3 x64', + runOn: 'rhel93-fips', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "RHEL 9.3 x64", - runOn: "rhel93-fips", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl3", - executableOsId: "linux-x64-openssl3", - mVersion: "stable", + displayName: 'RHEL 9.3 x64', + runOn: 'rhel93-fips', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-x64-openssl3', + mVersion: 'stable', }, { - displayName: "RHEL 9.3 x64", - runOn: "rhel93-fips", - tags: ["nightly-driver"], + displayName: 'RHEL 9.3 x64', + runOn: 'rhel93-fips', + tags: ['nightly-driver'], fips: true, - sharedOpenSsl: "openssl3", - executableOsId: "linux-x64-openssl3", - mVersion: "stable", + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-x64-openssl3', + mVersion: 'stable', }, { - displayName: "Ubuntu 18.04 x64", - runOn: "ubuntu1804-large", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "6.0.x", + displayName: 'Ubuntu 18.04 x64', + runOn: 'ubuntu1804-large', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '6.0.x', }, { - displayName: "Ubuntu 20.04 x64", - runOn: "ubuntu2004-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'Ubuntu 20.04 x64', + runOn: 'ubuntu2004-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "Ubuntu 20.04 x64", - runOn: "ubuntu2004-small", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl11", - executableOsId: "linux-x64-openssl11", - mVersion: "stable", + displayName: 'Ubuntu 20.04 x64', + runOn: 'ubuntu2004-small', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl11', + executableOsId: 'linux-x64-openssl11', + mVersion: 'stable', }, { - displayName: "Ubuntu 22.04 x64", - runOn: "ubuntu2204-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'Ubuntu 22.04 x64', + runOn: 'ubuntu2204-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "Ubuntu 22.04 x64", - runOn: "ubuntu2204-small", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl3", - executableOsId: "linux-x64-openssl3", - mVersion: "stable", + displayName: 'Ubuntu 22.04 x64', + runOn: 'ubuntu2204-small', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-x64-openssl3', + mVersion: 'stable', }, { - displayName: "Ubuntu 24.04 x64", - runOn: "ubuntu2404-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'Ubuntu 24.04 x64', + runOn: 'ubuntu2404-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "Ubuntu 24.04 x64", - runOn: "ubuntu2404-small", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl3", - executableOsId: "linux-x64-openssl3", - mVersion: "stable", + displayName: 'Ubuntu 24.04 x64', + runOn: 'ubuntu2404-small', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-x64-openssl3', + mVersion: 'stable', }, { - displayName: "Debian 10 x64", - runOn: "debian10-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "6.0.x", + displayName: 'Debian 10 x64', + runOn: 'debian10-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '6.0.x', }, { - displayName: "Debian 10 x64", - runOn: "debian10-small", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl11", - executableOsId: "linux-x64-openssl11", - mVersion: "6.0.x", + displayName: 'Debian 10 x64', + runOn: 'debian10-small', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl11', + executableOsId: 'linux-x64-openssl11', + mVersion: '6.0.x', }, { - displayName: "Debian 11 x64", - runOn: "debian11-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "7.0.x", + displayName: 'Debian 11 x64', + runOn: 'debian11-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '7.0.x', }, { - displayName: "Debian 11 x64", - runOn: "debian11-small", - tags: ["nightly-driver"], - sharedOpenSsl: "openssl11", - executableOsId: "linux-x64-openssl11", - mVersion: "7.0.x", + displayName: 'Debian 11 x64', + runOn: 'debian11-small', + tags: ['nightly-driver'], + sharedOpenSsl: 'openssl11', + executableOsId: 'linux-x64-openssl11', + mVersion: '7.0.x', }, { - displayName: "Amazon Linux 2 x64", - runOn: "amazon2-large", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "7.0.x", + displayName: 'Amazon Linux 2 x64', + runOn: 'amazon2-large', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '7.0.x', }, { - displayName: "Amazon Linux 2023 x64", - runOn: "amazon2023.0-small", - tags: ["nightly-driver"], + displayName: 'Amazon Linux 2023 x64', + runOn: 'amazon2023.0-small', + tags: ['nightly-driver'], disableOpenSslSharedConfig: true, - executableOsId: "linux-x64", - mVersion: "stable", + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "SLES 12 x64", - runOn: "suse12-sp5-large", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "7.0.x", + displayName: 'SLES 12 x64', + runOn: 'suse12-sp5-large', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: '7.0.x', }, { - displayName: "SLES 15 x64", - runOn: "suse15sp4-small", - tags: ["nightly-driver"], - executableOsId: "linux-x64", - mVersion: "stable", + displayName: 'SLES 15 x64', + runOn: 'suse15sp4-small', + tags: ['nightly-driver'], + executableOsId: 'linux-x64', + mVersion: 'stable', }, { - displayName: "Ubuntu 18.04 arm64", - runOn: "ubuntu1804-arm64-large", - executableOsId: "linux-arm64", - mVersion: "6.0.x", + displayName: 'Ubuntu 18.04 arm64', + runOn: 'ubuntu1804-arm64-large', + executableOsId: 'linux-arm64', + mVersion: '6.0.x', }, { - displayName: "Ubuntu 20.04 arm64", - runOn: "ubuntu2004-arm64-small", - executableOsId: "linux-arm64", - mVersion: "stable", + displayName: 'Ubuntu 20.04 arm64', + runOn: 'ubuntu2004-arm64-small', + executableOsId: 'linux-arm64', + mVersion: 'stable', }, { - displayName: "Ubuntu 20.04 arm64", - runOn: "ubuntu2004-arm64-small", - sharedOpenSsl: "openssl11", - executableOsId: "linux-arm64-openssl11", - mVersion: "stable", + displayName: 'Ubuntu 20.04 arm64', + runOn: 'ubuntu2004-arm64-small', + sharedOpenSsl: 'openssl11', + executableOsId: 'linux-arm64-openssl11', + mVersion: 'stable', }, { - displayName: "Ubuntu 22.04 arm64", - runOn: "ubuntu2204-arm64-small", - executableOsId: "linux-arm64", - mVersion: "stable", + displayName: 'Ubuntu 22.04 arm64', + runOn: 'ubuntu2204-arm64-small', + executableOsId: 'linux-arm64', + mVersion: 'stable', }, { - displayName: "Ubuntu 22.04 arm64", - runOn: "ubuntu2204-arm64-small", - sharedOpenSsl: "openssl3", - executableOsId: "linux-arm64-openssl3", - mVersion: "stable", + displayName: 'Ubuntu 22.04 arm64', + runOn: 'ubuntu2204-arm64-small', + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-arm64-openssl3', + mVersion: 'stable', }, { - displayName: "Ubuntu 24.04 arm64", - runOn: "ubuntu2404-arm64-small", - executableOsId: "linux-arm64", - mVersion: "stable", + displayName: 'Ubuntu 24.04 arm64', + runOn: 'ubuntu2404-arm64-small', + executableOsId: 'linux-arm64', + mVersion: 'stable', }, { - displayName: "Ubuntu 24.04 arm64", - runOn: "ubuntu2404-arm64-small", - sharedOpenSsl: "openssl3", - executableOsId: "linux-arm64-openssl3", - mVersion: "stable", + displayName: 'Ubuntu 24.04 arm64', + runOn: 'ubuntu2404-arm64-small', + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-arm64-openssl3', + mVersion: 'stable', }, { - displayName: "Amazon Linux 2 arm64", - runOn: "amazon2-arm64-large", - executableOsId: "linux-arm64", - mVersion: "7.0.x", + displayName: 'Amazon Linux 2 arm64', + runOn: 'amazon2-arm64-large', + executableOsId: 'linux-arm64', + mVersion: '7.0.x', }, { - displayName: "Amazon Linux 2023 arm64", - runOn: "amazon2023.0-arm64-small", + displayName: 'Amazon Linux 2023 arm64', + runOn: 'amazon2023.0-arm64-small', disableOpenSslSharedConfig: true, - executableOsId: "linux-arm64", - mVersion: "stable", + executableOsId: 'linux-arm64', + mVersion: 'stable', }, { - displayName: "RHEL 8.2 arm64", - runOn: "rhel82-arm64-small", - executableOsId: "linux-arm64", - mVersion: "stable", + displayName: 'RHEL 8.2 arm64', + runOn: 'rhel82-arm64-small', + executableOsId: 'linux-arm64', + mVersion: 'stable', }, { - displayName: "RHEL 9.0 arm64", - runOn: "rhel90-arm64-small", + displayName: 'RHEL 9.0 arm64', + runOn: 'rhel90-arm64-small', disableOpenSslSharedConfig: true, - executableOsId: "linux-arm64", - mVersion: "7.0.x", + executableOsId: 'linux-arm64', + mVersion: '7.0.x', }, { - displayName: "RHEL 9.0 arm64", - runOn: "rhel90-arm64-small", + displayName: 'RHEL 9.0 arm64', + runOn: 'rhel90-arm64-small', disableOpenSslSharedConfig: true, - sharedOpenSsl: "openssl3", - executableOsId: "linux-arm64-openssl3", - mVersion: "7.0.x", + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-arm64-openssl3', + mVersion: '7.0.x', }, { - displayName: "RHEL 9.3 arm64", - runOn: "rhel93-arm64-small", + displayName: 'RHEL 9.3 arm64', + runOn: 'rhel93-arm64-small', disableOpenSslSharedConfig: true, - executableOsId: "linux-arm64", - mVersion: "stable", + executableOsId: 'linux-arm64', + mVersion: 'stable', }, { - displayName: "RHEL 9.3 arm64", - runOn: "rhel93-arm64-small", + displayName: 'RHEL 9.3 arm64', + runOn: 'rhel93-arm64-small', disableOpenSslSharedConfig: true, - sharedOpenSsl: "openssl3", - executableOsId: "linux-arm64-openssl3", - mVersion: "stable", + sharedOpenSsl: 'openssl3', + executableOsId: 'linux-arm64-openssl3', + mVersion: 'stable', }, { - displayName: "RHEL 8 PPC", - runOn: "rhel8-power-small", - executableOsId: "linux-ppc64le", - mVersion: "stable", + displayName: 'RHEL 8 PPC', + runOn: 'rhel8-power-small', + executableOsId: 'linux-ppc64le', + mVersion: 'stable', }, { - displayName: "RHEL 7 s390x", - runOn: "rhel7-zseries-large", - executableOsId: "linux-s390x", - mVersion: "6.0.x", + displayName: 'RHEL 7 s390x', + runOn: 'rhel7-zseries-large', + executableOsId: 'linux-s390x', + mVersion: '6.0.x', }, { - displayName: "RHEL 8 s390x", - runOn: "rhel8-zseries-small", - executableOsId: "linux-s390x", - mVersion: "stable", + displayName: 'RHEL 8 s390x', + runOn: 'rhel8-zseries-small', + executableOsId: 'linux-s390x', + mVersion: 'stable', }, { - displayName: "MacOS 14 x64", - runOn: "macos-14", - executableOsId: "darwin-x64", - mVersion: "stable", + displayName: 'MacOS 14 x64', + runOn: 'macos-14', + executableOsId: 'darwin-x64', + mVersion: 'stable', }, { - displayName: "MacOS 14 arm64", - runOn: "macos-14-arm64", - executableOsId: "darwin-arm64", - mVersion: "stable", + displayName: 'MacOS 14 arm64', + runOn: 'macos-14-arm64', + executableOsId: 'darwin-arm64', + mVersion: 'stable', }, { - displayName: "MacOS Big Sur", - id: "darwin", - runOn: "macos-11", - executableOsId: "darwin-x64", - mVersion: "stable", + displayName: 'MacOS Big Sur', + id: 'darwin', + runOn: 'macos-11', + executableOsId: 'darwin-x64', + mVersion: 'stable', }, { - displayName: "MacOS Big Sur arm64", - runOn: "macos-11-arm64", - id: "darwin_arm64", - executableOsId: "darwin-arm64", - mVersion: "stable", + displayName: 'MacOS Big Sur arm64', + runOn: 'macos-11-arm64', + id: 'darwin_arm64', + executableOsId: 'darwin-arm64', + mVersion: 'stable', additionalTasks: [ - "package_artifact_darwin_x64", - "sign_artifact_darwin_x64", - "package_artifact_darwin_arm64", - "sign_artifact_darwin_arm64", + 'package_artifact_darwin_x64', + 'sign_artifact_darwin_x64', + 'package_artifact_darwin_arm64', + 'sign_artifact_darwin_arm64', ], }, { - displayName: "Windows VS 2022", - runOn: "windows-vsCurrent-small", - executableOsId: "win32", - mVersion: "stable", + displayName: 'Windows VS 2022', + runOn: 'windows-vsCurrent-small', + executableOsId: 'win32', + mVersion: 'stable', additionalTasks: [ - "package_artifact_win32_x64", - "package_artifact_win32msi_x64", + 'package_artifact_win32_x64', + 'package_artifact_win32msi_x64', ], }, ].map((buildVariant) => { const { displayName, fips, sharedOpenSsl, mVersion, runOn, executableOsId } = buildVariant; - let id = (buildVariant.id ?? runOn ?? executableOsId).replaceAll("-", "_"); + let id = (buildVariant.id ?? runOn ?? executableOsId).replaceAll('-', '_'); const name = [ - "e2e_tests", + 'e2e_tests', id, sharedOpenSsl, - mVersion != "stable" ? `m${mVersion.replaceAll(".", "")}` : undefined, + mVersion != 'stable' ? `m${mVersion.replaceAll('.', '')}` : undefined, fips, ] .filter((text) => text) - .join("_"); + .join('_'); const formattedDisplayName = [ displayName, - mVersion != "stable" ? mVersion.replaceAll(".", "") : undefined, + mVersion != 'stable' ? mVersion.replaceAll('.', '') : undefined, sharedOpenSsl, - fips ? "FIPS" : undefined, - "(E2E tests)", + fips ? 'FIPS' : undefined, + '(E2E tests)', ] .filter((text) => text) - .join(" "); + .join(' '); let compileBuildVariant = COMPILE_BUILD_VARIANTS.find( (pkg) => pkg.executableOsId == executableOsId diff --git a/.evergreen/build-variants/unit-tests-build-variants.d.ts b/.evergreen/build-variants/unit-tests-build-variants.d.ts new file mode 100644 index 0000000000..d9862ea96e --- /dev/null +++ b/.evergreen/build-variants/unit-tests-build-variants.d.ts @@ -0,0 +1,15 @@ +export type UnitTestsBuildVariant = { + displayName: string; + runOn: string; + executableOsId: string; + name: string; + id: string; + runWithUnitTestsOnly: boolean; + tags: string[]; + platform: string; + nShort: string; + nVersion: string; + skipNodeVersionCheck: boolean; +}; + +export const UNIT_TESTS_BUILD_VARIANTS: UnitTestsBuildVariant[]; diff --git a/.evergreen/build-variants/unit-tests-build-variants.js b/.evergreen/build-variants/unit-tests-build-variants.js new file mode 100644 index 0000000000..3b27749699 --- /dev/null +++ b/.evergreen/build-variants/unit-tests-build-variants.js @@ -0,0 +1,72 @@ +//@ts-check +const { + MONGODB_VERSIONS, + NODE_VERSIONS, + PLATFORMS, + platformToDetails, +} = require('../constants'); + +/** @type {import("./unit-tests-build-variants.js").UnitTestsBuildVariant[]} */ +const UNIT_TESTS_BUILD_VARIANTS = []; + +for (const { + shortName: nShort, + versionSpec: nVersion, + skipNodeVersionCheck, +} of NODE_VERSIONS) { + for (const platform of PLATFORMS) { + const platformDetails = platformToDetails[platform]; + UNIT_TESTS_BUILD_VARIANTS.push({ + ...platformDetails, + name: `${platform}-n${nShort}`, + displayName: `${platformDetails.displayName} n${nShort} (Unit tests)`, + id: `${platform}-n${nShort}`, + runWithUnitTestsOnly: true, + tags: platformDetails.tags ?? [], + platform, + nShort, + nVersion, + skipNodeVersionCheck, + }); + for (const { + shortName: mShort, + versionSpec: mVersion, + } of MONGODB_VERSIONS) { + if ( + mShort === '42xe' && + (platform === 'linux' || platform === 'darwin') + ) { + // The MongoDB 4.2 enterprise server does not work on Ubuntu 20.04 or arm64 macOS + continue; + } + if ( + ['42xc', '42xe', '44xc', '44xe', '50xc', '50xe'].includes(mShort) && + platform === 'darwin' + ) { + // Unit tests on macOS use arm64 and therefore require 6.0+ + continue; + } + UNIT_TESTS_BUILD_VARIANTS.push({ + ...platformDetails, + name: `tests_${platform}-m${mShort}_n${nShort}`, + id: `${platform}-m${mShort}_n${nShort}`, + runWithUnitTestsOnly: false, + tags: [ + ...(platformDetails.tags ?? []), + ...(mShort === 'latest' ? ['mlatest'] : []), + ], + displayName: `${platformDetails.displayName}${ + mShort === undefined ? '' : ` m${mShort}` + } n${nShort} (Unit tests)`, + platform, + nShort, + nVersion, + mShort, + mVersion, + skipNodeVersionCheck, + }); + } + } +} + +exports.UNIT_TESTS_BUILD_VARIANTS = UNIT_TESTS_BUILD_VARIANTS; diff --git a/.evergreen/constants.js b/.evergreen/constants.js new file mode 100644 index 0000000000..38c3c48aab --- /dev/null +++ b/.evergreen/constants.js @@ -0,0 +1,49 @@ +// @ts-check + +exports.PLATFORMS = ['darwin', 'linux', 'win32']; + +exports.platformToDetails = { + darwin: { + displayName: 'MacOS 14 arm64', + runOn: 'macos-14-arm64', + executableOsId: 'darwin-arm64', + }, + linux: { + displayName: 'Ubuntu 20.04 x64', + runOn: 'ubuntu2004-small', + executableOsId: 'darwin-arm64', + tags: ['nightly-driver'], + }, + win32: { + displayName: 'Windows', + runOn: 'windows-vsCurrent-small', + executableOsId: 'win32', + }, +}; + +const NODE_JS_VERSION_20 = require('./node-20-latest.json').version; +exports.NODE_JS_VERSION_20 = NODE_JS_VERSION_20; + +exports.MONGODB_VERSIONS = [ + { shortName: '42xc', versionSpec: '4.2.x' }, + { shortName: '42xe', versionSpec: '4.2.x-enterprise' }, + { shortName: '44xc', versionSpec: '4.4.x' }, + { shortName: '44xe', versionSpec: '4.4.x-enterprise' }, + { shortName: '50xc', versionSpec: '5.0.x' }, + { shortName: '50xe', versionSpec: '5.0.x-enterprise' }, + { shortName: '60xc', versionSpec: '6.0.x' }, + { shortName: '60xe', versionSpec: '6.0.x-enterprise' }, + { shortName: '70xc', versionSpec: '7.0.x' }, + { shortName: '70xe', versionSpec: '7.0.x-enterprise' }, + { shortName: '80xc', versionSpec: '8.0.x' }, + { shortName: '80xe', versionSpec: '8.0.x-enterprise' }, + { shortName: 'latest', versionSpec: 'latest-alpha-enterprise' }, +]; + +exports.NODE_VERSIONS = [ + { + shortName: '20', + versionSpec: NODE_JS_VERSION_20, + skipNodeVersionCheck: '', + }, +]; diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 7a9afb089d..a4ca546f85 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -1,97 +1,12 @@ <% -const path = require('path'); - -const NODE_JS_VERSION_20 = require('./node-20-latest.json').version; - -const MONGODB_VERSIONS = [ - { shortName: '42xc', versionSpec: '4.2.x' }, - { shortName: '42xe', versionSpec: '4.2.x-enterprise' }, - { shortName: '44xc', versionSpec: '4.4.x' }, - { shortName: '44xe', versionSpec: '4.4.x-enterprise' }, - { shortName: '50xc', versionSpec: '5.0.x' }, - { shortName: '50xe', versionSpec: '5.0.x-enterprise' }, - { shortName: '60xc', versionSpec: '6.0.x' }, - { shortName: '60xe', versionSpec: '6.0.x-enterprise' }, - { shortName: '70xc', versionSpec: '7.0.x' }, - { shortName: '70xe', versionSpec: '7.0.x-enterprise' }, - { shortName: '80xc', versionSpec: '8.0.x' }, - { shortName: '80xe', versionSpec: '8.0.x-enterprise' }, - { shortName: 'latest', versionSpec: 'latest-alpha-enterprise' } -]; -const NODE_VERSIONS = [ - { shortName: '20', versionSpec: NODE_JS_VERSION_20, skipNodeVersionCheck: '' } -]; - -const pathToPackages = path.join(__dirname, '..', 'packages'); -const MONGOSH_PACKAGES = fs.readdirSync(pathToPackages, { withFileTypes: true }) - .filter(d => d.isDirectory() && fs.existsSync(path.join(pathToPackages, d.name, 'package.json'))) - .map(d => ({ - name: d.name, - ...(JSON.parse(fs.readFileSync(path.join(pathToPackages, d.name, 'package.json'))).mongosh || {}) - })); - -const platformToDetails = { - 'darwin': { displayName: 'MacOS 14 arm64', runOn: 'macos-14-arm64', executableOsId: 'darwin-arm64' }, - 'linux': { displayName: 'Ubuntu 20.04 x64', runOn: 'ubuntu2004-small', executableOsId: 'darwin-arm64', tags: ["nightly-driver"]}, - 'win32': { displayName: 'Windows', runOn: 'windows-vsCurrent-small', executableOsId: 'win32' }, -} -const defaultVariants = ['darwin', 'linux', 'win32']; - -const UNIT_TESTS_BUILD_VARIANTS = []; -const UNIT_TESTS = []; - -for (const { shortName: nShort, versionSpec: nVersion, skipNodeVersionCheck } of NODE_VERSIONS) { - for (const platform of defaultVariants) { - const platformDetails = platformToDetails[platform]; - UNIT_TESTS_BUILD_VARIANTS.push({ - ...platformDetails, - name: `${platform}-n${nShort}`, - displayName: `${platformDetails.displayName} n${nShort} (Unit tests)`, - id: `${platform}-n${nShort}`, - runWithUnitTestsOnly: true, - tags: platformDetails.tags ?? [], - platform, nShort, nVersion, skipNodeVersionCheck, - }); - for (const { shortName: mShort, versionSpec: mVersion } of MONGODB_VERSIONS) { - if (mShort === '42xe' && (platform === 'linux' || platform === 'darwin')) { - // The MongoDB 4.2 enterprise server does not work on Ubuntu 20.04 or arm64 macOS - continue; - } - if (['42xc', '42xe', '44xc', '44xe', '50xc', '50xe'].includes(mShort) && (platform === 'darwin')) { - // Unit tests on macOS use arm64 and therefore require 6.0+ - continue; - } - UNIT_TESTS_BUILD_VARIANTS.push({ - ...platformDetails, - name: `tests_${platform}-m${mShort}_n${nShort}`, - id: `${platform}-m${mShort}_n${nShort}`, - runWithUnitTestsOnly: false, - tags: [...(platformDetails.tags ?? []), ...(mShort === 'latest' ? ["mlatest"] : [])], - displayName: `${platformDetails.displayName}${mShort === undefined ? '' : ` m${mShort}`} n${nShort} (Unit tests)`, - platform, - nShort, nVersion, mShort, mVersion, skipNodeVersionCheck, - }); - } - } -} - - -for (const packageInfo of MONGOSH_PACKAGES) { - const id = `${packageInfo.name.replace(/-/g, '_')}`; - - const variants = packageInfo.variants ?? defaultVariants - UNIT_TESTS.push({ - id, - packageName: packageInfo.name, - unitTestsOnly: packageInfo.unitTestsOnly, - variants, - }); -} +const { RELEASE_PACKAGE_MATRIX } = require('../config/release-package-matrix') +const { NODE_JS_VERSION_20 } = require('./constants') +const { UNIT_TESTS_BUILD_VARIANTS } = require('./build-variants/unit-tests-build-variants') const { E2E_TESTS_BUILD_VARIANTS } = require('./build-variants/e2e-tests-build-variants') const { COMPILE_BUILD_VARIANTS } = require('./build-variants/compile-build-variants') -const { RELEASE_PACKAGE_MATRIX } = require('../config/release-package-matrix') +const { UNIT_TESTS } = require('./tasks/unit-tests') %> exec_timeout_secs: 10800 diff --git a/.evergreen/tasks/unit-tests.js b/.evergreen/tasks/unit-tests.js new file mode 100644 index 0000000000..f8766e7653 --- /dev/null +++ b/.evergreen/tasks/unit-tests.js @@ -0,0 +1,38 @@ +// @ts-check +const path = require('path'); +const fs = require('fs'); +const { PLATFORMS } = require('../constants'); + +const UNIT_TESTS = []; + +const pathToPackages = path.join(__dirname, '..', '..', 'packages'); +const MONGOSH_PACKAGES = fs + .readdirSync(pathToPackages, { withFileTypes: true }) + .filter( + (d) => + d.isDirectory() && + fs.existsSync(path.join(pathToPackages, d.name, 'package.json')) + ) + .map((d) => ({ + name: d.name, + ...(JSON.parse( + fs.readFileSync( + path.join(pathToPackages, d.name, 'package.json'), + 'utf-8' + ) + ).mongosh || {}), + })); + +for (const packageInfo of MONGOSH_PACKAGES) { + const id = `${packageInfo.name.replace(/-/g, '_')}`; + + const variants = packageInfo.variants ?? PLATFORMS; + UNIT_TESTS.push({ + id, + packageName: packageInfo.name, + unitTestsOnly: packageInfo.unitTestsOnly, + variants, + }); +} + +exports.UNIT_TESTS = UNIT_TESTS;