From 2ffc024ab6608d2f2d7da230f5ddf7dc4bbf4065 Mon Sep 17 00:00:00 2001 From: hasezoey Date: Tue, 2 Jul 2024 14:43:53 +0200 Subject: [PATCH] fix(MongoBinaryDownloadUrl): add mapping for Linux Mint 22 even though there are still no ubuntu 24.04 binaries --- docs/guides/supported-systems.md | 2 +- .../src/util/MongoBinaryDownloadUrl.ts | 3 ++- .../src/util/__tests__/MongoBinaryDownloadUrl.test.ts | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/docs/guides/supported-systems.md b/docs/guides/supported-systems.md index a7bb0e04..78dc92d1 100644 --- a/docs/guides/supported-systems.md +++ b/docs/guides/supported-systems.md @@ -126,7 +126,7 @@ Default version is `7` (uses mongodb's `ubuntu` release)
Lowest supported Distribution version is `17`
-Highest version is `21`
+Highest version is `22`
Default version is `21` ### Suse diff --git a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts index f8583e8e..79c5b605 100644 --- a/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts +++ b/packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts @@ -481,6 +481,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts { 19: '18.04', 20: '20.04', 21: '22.04', + 22: '24.04', }; ubuntuOS = { @@ -587,7 +588,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts { * Highest ubuntu year supported by mongodb binaries * @see https://www.mongodb.com/download-center/community/releases/archive */ - const highestUbuntuYear = 22; // 22 is the highest supported as of mongodb 7.0.9 + const highestUbuntuYear = 22; // 22 is the highest supported as of mongodb 7.0.11 if (ubuntuYear > highestUbuntuYear) { log( diff --git a/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts b/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts index 623998e7..ec3a5651 100644 --- a/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts +++ b/packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts @@ -1071,6 +1071,15 @@ describe('MongoBinaryDownloadUrl', () => { 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz' ); }); + + it('should return a archive name for Linux Mint 21', async () => { + (downloadUrl.os as LinuxOS).release = '22'; + downloadUrl.version = '7.0.11'; + // NOTE: there are currently no binaries for ubuntu 24.04, but 22.04 still work + expect(await downloadUrl.getDownloadUrl()).toBe( + 'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.11.tgz' + ); + }); }); describe('for fedora', () => {