Skip to content

Commit

Permalink
fix(MongoBinaryDownloadUrl): use debian92 for versions <4.2.0
Browse files Browse the repository at this point in the history
fixes #448
  • Loading branch information
hasezoey committed Mar 8, 2021
1 parent 23374e3 commit 7bb5097
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,14 @@ export default class MongoBinaryDownloadUrl {
let name = 'debian';
const release: number = parseFloat(os.release);
if (release >= 10 || ['unstable', 'testing'].includes(os.release)) {
name += '10';
if (semver.lte(this.version, '4.2.0')) {
log(
`getDebianVersionString: requested version "${this.version}" not available for osrelease "${release}", using "92"`
);
name += '92';
} else {
name += '10';
}
} else if (release >= 9) {
name += '92';
} else if (release >= 8.1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for debian', async () => {
it('for debian 81 for 3.6.3', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
Expand All @@ -80,6 +80,22 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for debian 10 for 4.0.20 should use debian 92 [#448]', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '4.0.20',
os: {
os: 'linux',
dist: 'debian',
release: '10',
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian92-4.0.20.tgz'
);
});

describe('for win32 & windows', () => {
it('3.6 (win32)', async () => {
const du = new MongoBinaryDownloadUrl({
Expand Down

0 comments on commit 7bb5097

Please sign in to comment.