Skip to content

Commit ecc4ffe

Browse files
committed
fix(MongoBinaryDownloadUrl): change default elementary version to 7
1 parent df97ea8 commit ecc4ffe

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

docs/guides/supported-systems.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Default version is `1`
118118
(uses mongodb's `ubuntu` release)<br/>
119119
Lowest supported Distribution version is `3` (or `0.3`)<br/>
120120
Highest version is `7`<br/>
121-
Default version is `6`
121+
Default version is `7`
122122

123123
### Linux Mint
124124

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
502502

503503
// untangle elemenatary versioning from hell https://en.wikipedia.org/wiki/Elementary_OS#Development
504504
const [elementaryMajor, elementaryMinor] = os.release.split('.').map((el) => parseInt(el));
505+
// versions below 5.0 were named 0.X, and so use the minor version if major is 0
505506
const realMajor = elementaryMajor || elementaryMinor;
506507

507508
ubuntuOS = {
508509
os: 'linux',
509510
dist: 'ubuntu',
510-
// TODO: next-minor: change default elemenatry release to 7
511-
release: elementaryToUbuntuRelease[realMajor] || elementaryToUbuntuRelease[6],
511+
release: elementaryToUbuntuRelease[realMajor] || elementaryToUbuntuRelease[7],
512512
};
513513
}
514514
}

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,25 @@ describe('MongoBinaryDownloadUrl', () => {
892892
});
893893

894894
describe('for elementary', () => {
895+
it('should default to Elementary 7, if version cannot be found in lookup table', async () => {
896+
const du = new MongoBinaryDownloadUrl({
897+
platform: 'linux',
898+
arch: 'x64',
899+
version: '6.0.4',
900+
os: {
901+
os: 'linux',
902+
dist: 'elementary',
903+
codename: 'horus',
904+
release: '0',
905+
id_like: ['ubuntu'],
906+
},
907+
});
908+
909+
expect(await du.getDownloadUrl()).toBe(
910+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz'
911+
);
912+
});
913+
895914
it('should return a archive name for elementary 0.3', async () => {
896915
const du = new MongoBinaryDownloadUrl({
897916
platform: 'linux',

0 commit comments

Comments
 (0)