Skip to content

Commit 20dab94

Browse files
jeysalhasezoey
authored andcommitted
fix(MongoBinaryDownloadUrl): update mapping for arch to "ubuntu2204"
1 parent ebee094 commit 20dab94

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,13 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
203203
// Match "arch", "archlinux", "manjaro", "manjarolinux", "arco", "arcolinux"
204204
} else if (regexHelper(/(arch|manjaro|arco)(?:linux)?$/i, os)) {
205205
console.warn(
206-
`There is no official build of MongoDB for ArchLinux (${os.dist}). Falling back to Ubuntu 20.04 release.`
206+
`There is no official build of MongoDB for ArchLinux (${os.dist}). Falling back to Ubuntu 22.04 release.`
207207
);
208208

209209
return this.getUbuntuVersionString({
210210
os: 'linux',
211211
dist: 'Ubuntu Linux',
212-
release: '20.04',
212+
release: '22.04',
213213
});
214214
} else if (regexHelper(/gentoo/i, os)) {
215215
// it seems like debian binaries work for gentoo too (at least most), see https://github.com/nodkz/mongodb-memory-server/issues/639

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

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,7 +1684,7 @@ describe('MongoBinaryDownloadUrl', () => {
16841684
});
16851685

16861686
describe('getLinuxOSVersionString()', () => {
1687-
it('should give an warning about "alpine"', () => {
1687+
it('should give a warning about "alpine"', () => {
16881688
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
16891689
const du = new MongoBinaryDownloadUrl({
16901690
platform: 'linux',
@@ -1704,7 +1704,7 @@ describe('MongoBinaryDownloadUrl', () => {
17041704
expect(ret).toBe('');
17051705
});
17061706

1707-
it('should give an warning about "unknown"', () => {
1707+
it('should give a warning about "unknown"', () => {
17081708
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
17091709
const du = new MongoBinaryDownloadUrl({
17101710
platform: 'linux',
@@ -1723,6 +1723,24 @@ describe('MongoBinaryDownloadUrl', () => {
17231723
expect(du.getLegacyVersionString).toHaveBeenCalledTimes(1);
17241724
expect(ret).toBe('');
17251725
});
1726+
1727+
it('should give a warning about "arch"', () => {
1728+
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
1729+
const du = new MongoBinaryDownloadUrl({
1730+
platform: 'linux',
1731+
arch: 'x64',
1732+
version: '3.6.3',
1733+
os: {
1734+
os: 'linux',
1735+
dist: 'archlinux',
1736+
release: '0',
1737+
codename: 'archlinux',
1738+
},
1739+
});
1740+
const ret = du.getLinuxOSVersionString(du.os as LinuxOS);
1741+
expect(console.warn).toHaveBeenCalledTimes(1);
1742+
expect(ret).toBe('ubuntu1604');
1743+
});
17261744
});
17271745

17281746
describe('translateArch()', () => {

0 commit comments

Comments
 (0)