Skip to content

Commit 7cc91e6

Browse files
committed
fix(MongoBinaryDownloadUrl): use "rhel90" before mongodb 8.0.0
fixes #942 re #941
1 parent 4f8e9c1 commit 7cc91e6

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
425425

426426
// as of mongodb 8.0.9, there are currently no binaries for rhel 10.0
427427

428-
if (semver.satisfies(releaseAsSemver, '>=9.3.0')) {
428+
if (semver.satisfies(releaseAsSemver, '>=9.3.0') && semver.gte(coercedVersion, '8.0.0')) {
429429
// since mongodb 8.0.0 there are only binaries for `rhel93`, no more `rhel90`
430430
name += '93';
431431
} else if (semver.satisfies(releaseAsSemver, '>=9.0.0')) {

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,6 +1564,22 @@ describe('MongoBinaryDownloadUrl', () => {
15641564
);
15651565
});
15661566

1567+
it('rhel 9.3 (x86_64) & 7.0.14', async () => {
1568+
const du = new MongoBinaryDownloadUrl({
1569+
platform: 'linux',
1570+
arch: 'x64',
1571+
version: '7.0.14',
1572+
os: {
1573+
os: 'linux',
1574+
dist: 'rhel',
1575+
release: '9.3',
1576+
},
1577+
});
1578+
expect(await du.getDownloadUrl()).toBe(
1579+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel90-7.0.14.tgz'
1580+
);
1581+
});
1582+
15671583
it('rhel 9.3 (x86_64) & 8.0.0', async () => {
15681584
const du = new MongoBinaryDownloadUrl({
15691585
platform: 'linux',

0 commit comments

Comments
 (0)