Skip to content

Commit e756164

Browse files
committed
fix(MongoBinaryDownloadUrl): support linux-mint 21
years later
1 parent 9a29af9 commit e756164

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

docs/guides/supported-systems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Default version is `6`
126126

127127
(uses mongodb's `ubuntu` release)<br/>
128128
Lowest supported Distribution version is `17`<br/>
129-
Highest version is `20`<br/>
129+
Highest version is `21`<br/>
130130
Default version is `20`
131131

132132
### Suse

packages/mongodb-memory-server-core/src/util/MongoBinaryDownloadUrl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,14 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
469469
18: '16.04',
470470
19: '18.04',
471471
20: '20.04',
472+
21: '22.04',
472473
};
473474

474475
ubuntuOS = {
475476
os: 'linux',
476477
dist: 'ubuntu',
477478
release:
479+
// TODO: next-minor: change default mint release to 21
478480
mintToUbuntuRelease[parseInt(os.release.split('.')[0])] || mintToUbuntuRelease[20],
479481
};
480482
}

packages/mongodb-memory-server-core/src/util/__tests__/MongoBinaryDownloadUrl.test.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ describe('MongoBinaryDownloadUrl', () => {
901901
downloadUrl = new MongoBinaryDownloadUrl({
902902
platform: 'linux',
903903
arch: 'x64',
904-
version: '4.0.25',
904+
version: '0.0.0',
905905
os: {
906906
os: 'linux',
907907
dist: 'Linux Mint',
@@ -912,37 +912,50 @@ describe('MongoBinaryDownloadUrl', () => {
912912
});
913913

914914
it('should default to Mint Version 20, if version cannot be found in lookup table', async () => {
915-
(downloadUrl.os as LinuxOS).release = '16';
915+
(downloadUrl.os as LinuxOS).release = '16'; // out-of-range version
916+
downloadUrl.version = '6.0.4';
916917
expect(await downloadUrl.getDownloadUrl()).toBe(
917-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.25.tgz'
918+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz'
918919
);
919920
});
920921

921922
it('should return a archive name for Linux Mint 17', async () => {
922923
(downloadUrl.os as LinuxOS).release = '17';
924+
downloadUrl.version = '4.0.25';
923925
expect(await downloadUrl.getDownloadUrl()).toBe(
924926
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1404-4.0.25.tgz'
925927
);
926928
});
927929

928930
it('should return a archive name for Linux Mint 18', async () => {
929931
(downloadUrl.os as LinuxOS).release = '18';
932+
downloadUrl.version = '4.0.25';
930933
expect(await downloadUrl.getDownloadUrl()).toBe(
931934
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.0.25.tgz'
932935
);
933936
});
934937

935938
it('should return a archive name for Linux Mint 19', async () => {
936939
(downloadUrl.os as LinuxOS).release = '19';
940+
downloadUrl.version = '4.0.25';
937941
expect(await downloadUrl.getDownloadUrl()).toBe(
938942
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.25.tgz'
939943
);
940944
});
941945

942946
it('should return a archive name for Linux Mint 20', async () => {
943947
(downloadUrl.os as LinuxOS).release = '20';
948+
downloadUrl.version = '6.0.4';
944949
expect(await downloadUrl.getDownloadUrl()).toBe(
945-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.0.25.tgz'
950+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2004-6.0.4.tgz'
951+
);
952+
});
953+
954+
it('should return a archive name for Linux Mint 21', async () => {
955+
(downloadUrl.os as LinuxOS).release = '21';
956+
downloadUrl.version = '6.0.4';
957+
expect(await downloadUrl.getDownloadUrl()).toBe(
958+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz'
946959
);
947960
});
948961
});

0 commit comments

Comments
 (0)