Skip to content

Commit

Permalink
fix(MongoBinaryDownloadUrl): update mapping for arch to "ubuntu2204"
Browse files Browse the repository at this point in the history
  • Loading branch information
jeysal authored and hasezoey committed Apr 3, 2023
1 parent ebee094 commit 20dab94
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
Expand Up @@ -203,13 +203,13 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
// Match "arch", "archlinux", "manjaro", "manjarolinux", "arco", "arcolinux"
} else if (regexHelper(/(arch|manjaro|arco)(?:linux)?$/i, os)) {
console.warn(
`There is no official build of MongoDB for ArchLinux (${os.dist}). Falling back to Ubuntu 20.04 release.`
`There is no official build of MongoDB for ArchLinux (${os.dist}). Falling back to Ubuntu 22.04 release.`
);

return this.getUbuntuVersionString({
os: 'linux',
dist: 'Ubuntu Linux',
release: '20.04',
release: '22.04',
});
} else if (regexHelper(/gentoo/i, os)) {
// it seems like debian binaries work for gentoo too (at least most), see https://github.com/nodkz/mongodb-memory-server/issues/639
Expand Down
Expand Up @@ -1684,7 +1684,7 @@ describe('MongoBinaryDownloadUrl', () => {
});

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

it('should give an warning about "unknown"', () => {
it('should give a warning about "unknown"', () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
Expand All @@ -1723,6 +1723,24 @@ describe('MongoBinaryDownloadUrl', () => {
expect(du.getLegacyVersionString).toHaveBeenCalledTimes(1);
expect(ret).toBe('');
});

it('should give a warning about "arch"', () => {
jest.spyOn(console, 'warn').mockImplementation(() => void 0);
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '3.6.3',
os: {
os: 'linux',
dist: 'archlinux',
release: '0',
codename: 'archlinux',
},
});
const ret = du.getLinuxOSVersionString(du.os as LinuxOS);
expect(console.warn).toHaveBeenCalledTimes(1);
expect(ret).toBe('ubuntu1604');
});
});

describe('translateArch()', () => {
Expand Down

0 comments on commit 20dab94

Please sign in to comment.