Skip to content

Commit 219ed36

Browse files
committed
Merge branch 'master' into beta
2 parents fc59ea4 + fdf3d64 commit 219ed36

File tree

14 files changed

+154
-61
lines changed

14 files changed

+154
-61
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
node-version: ${{ matrix.node-version }}
3535
- name: Load MongoDB binary cache
3636
id: cache-mongodb-binaries
37-
uses: actions/cache@v3
37+
uses: actions/cache@v4
3838
with:
3939
path: ~/.cache/mongodb-binaries
4040
key: ${{ matrix.node-version }}

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
## [9.1.8](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.7...v9.1.8) (2024-03-28)
2+
3+
4+
### Fixes
5+
6+
* **MongoBinaryDownloadUrl:** support Debian 12 (Bookworm) ([#858](https://github.com/nodkz/mongodb-memory-server/issues/858)) ([48dbf43](https://github.com/nodkz/mongodb-memory-server/commit/48dbf434d93f1d184401529d2de6cf7943c13cd5))
7+
8+
## [9.1.7](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.6...v9.1.7) (2024-03-11)
9+
10+
11+
### Fixes
12+
13+
* **MongoBinaryDownloadUrl:** spelling mistake ([#854](https://github.com/nodkz/mongodb-memory-server/issues/854)) ([31ae840](https://github.com/nodkz/mongodb-memory-server/commit/31ae8403dddd2ac0bd82cffdde5a95aa74fa2e31))
14+
15+
## [9.1.6](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.5...v9.1.6) (2024-01-17)
16+
17+
18+
### Fixes
19+
20+
* **MongoBinaryDownloadUrl:** clamp ubuntu-year to highest supported year ([9a29af9](https://github.com/nodkz/mongodb-memory-server/commit/9a29af9032931d5105b0189bcddd4fc09c55048c)), closes [#846](https://github.com/nodkz/mongodb-memory-server/issues/846)
21+
* **MongoBinaryDownloadUrl:** support elementaryos 7 ([064c69e](https://github.com/nodkz/mongodb-memory-server/commit/064c69e860514047fe0a6a12648a00648362d51a))
22+
* **MongoBinaryDownloadUrl:** support linux-mint 21 ([e756164](https://github.com/nodkz/mongodb-memory-server/commit/e7561647bef9fa0fe490e797134d003e03b9d362))
23+
124
## [9.1.6-beta.1](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.5...v9.1.6-beta.1) (2024-01-17)
225

326

docs/guides/supported-systems.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ See [this mongodb issue](https://jira.mongodb.org/browse/SERVER-62300).
7171

7272
(uses mongodb's `debian` release)<br/>
7373
Lowest supported Distribution version is `71`<br/>
74-
Highest version is `11` (higher versions will be clamped to this value)<br/>
75-
Default version is `10` (when in `unstable` or `testing`, otherwise none)
74+
Highest version is `12` (higher versions will be clamped to this value)<br/>
75+
Default version is `12` (when in `unstable` or `testing`, otherwise none)
7676

7777
### Fedora
7878

packages/mongodb-memory-server-core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-memory-server-core",
3-
"version": "9.1.6-beta.1",
3+
"version": "9.1.8",
44
"description": "MongoDB Server for testing (core package, without autodownload). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.",
55
"main": "lib/index",
66
"types": "lib/index.d.ts",
@@ -46,7 +46,7 @@
4646
"camelcase": "^6.3.0",
4747
"debug": "^4.3.4",
4848
"find-cache-dir": "^3.3.2",
49-
"follow-redirects": "^1.15.3",
49+
"follow-redirects": "^1.15.6",
5050
"https-proxy-agent": "^7.0.2",
5151
"mongodb": "^5.9.1",
5252
"new-find-package-json": "^2.0.0",

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
235235
} else if (regexHelper(/debian/i, os)) {
236236
return this.getDebianVersionString(os);
237237
} else if (regexHelper(/alpine/i, os)) {
238-
console.warn('There is no offical build of MongoDB for Alpine!');
238+
console.warn('There is no official build of MongoDB for Alpine!');
239239
// Match "arch", "archlinux", "manjaro", "manjarolinux", "arco", "arcolinux"
240240
} else if (regexHelper(/(arch|manjaro|arco)(?:linux)?$/i, os)) {
241241
console.warn(
@@ -286,7 +286,9 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
286286
// see https://tracker.debian.org/news/1433360/accepted-base-files-13-source-into-unstable/
287287
const isTesting = ['unstable', 'testing', ''].includes(os.release);
288288

289-
if (isTesting || release >= 11) {
289+
if (isTesting || release >= 12) {
290+
name += '12';
291+
} else if (release >= 11) {
290292
// Debian 11 is compatible with the binaries for debian 10
291293
// but does not have binaries for before 5.0.8
292294
// and only set to use "debian10" if the requested version is not a latest version
@@ -306,7 +308,16 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
306308
name += '71';
307309
}
308310

309-
if (isTesting || release >= 10) {
311+
if (isTesting || release >= 12) {
312+
if (semver.lt(coercedVersion, '7.0.3') && !testVersionIsLatest(this.version)) {
313+
throw new KnownVersionIncompatibilityError(
314+
`Debian ${release || os.release || os.codename}`,
315+
this.version,
316+
'>=7.0.3',
317+
'Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release'
318+
);
319+
}
320+
} else if (release >= 10) {
310321
if (semver.lt(coercedVersion, '4.2.1') && !testVersionIsLatest(this.version)) {
311322
throw new KnownVersionIncompatibilityError(
312323
`Debian ${release || os.release || os.codename}`,

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

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,22 @@ describe('MongoBinaryDownloadUrl', () => {
556556
);
557557
});
558558

559+
it('for debian 12 for 7.0.3', async () => {
560+
const du = new MongoBinaryDownloadUrl({
561+
platform: 'linux',
562+
arch: 'x64',
563+
version: '7.0.3',
564+
os: {
565+
os: 'linux',
566+
dist: 'debian',
567+
release: '12',
568+
},
569+
});
570+
expect(await du.getDownloadUrl()).toBe(
571+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.3.tgz'
572+
);
573+
});
574+
559575
it('should allow v5.0-latest', async () => {
560576
const du = new MongoBinaryDownloadUrl({
561577
platform: 'linux',
@@ -576,15 +592,15 @@ describe('MongoBinaryDownloadUrl', () => {
576592
const du = new MongoBinaryDownloadUrl({
577593
platform: 'linux',
578594
arch: 'x64',
579-
version: '5.0.9',
595+
version: '7.0.3',
580596
os: {
581597
os: 'linux',
582598
dist: 'debian',
583599
release: '',
584600
},
585601
});
586602
expect(await du.getDownloadUrl()).toBe(
587-
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-5.0.9.tgz'
603+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.3.tgz'
588604
);
589605
});
590606

@@ -670,11 +686,49 @@ describe('MongoBinaryDownloadUrl', () => {
670686
}
671687
});
672688

673-
it('should throw a Error when requesting a version below 4.2.1 for debian testing [KnownVersionIncompatibilityError]', async () => {
689+
it('should throw an error when requesting a version below 7.0.3 for debian 12+ [#797] [KnownVersionIncompatibilityError]', async () => {
674690
const du = new MongoBinaryDownloadUrl({
675691
platform: 'linux',
676692
arch: 'x64',
677-
version: '4.0.25',
693+
version: '7.0.2',
694+
os: {
695+
os: 'linux',
696+
dist: 'debian',
697+
release: '12',
698+
},
699+
});
700+
701+
try {
702+
await du.getDownloadUrl();
703+
fail('Expected to throw a KnownVersionIncompatibilityError');
704+
} catch (err) {
705+
assertIsError(err);
706+
expect(err).toBeInstanceOf(KnownVersionIncompatibilityError);
707+
expect(err.message).toMatchSnapshot();
708+
}
709+
});
710+
711+
it('should not throw an error for v7.0-latest for debian 12', async () => {
712+
const du = new MongoBinaryDownloadUrl({
713+
platform: 'linux',
714+
arch: 'x64',
715+
version: 'v7.0-latest',
716+
os: {
717+
os: 'linux',
718+
dist: 'debian',
719+
release: '12',
720+
},
721+
});
722+
expect(await du.getDownloadUrl()).toBe(
723+
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-v7.0-latest.tgz'
724+
);
725+
});
726+
727+
it('should throw a Error when requesting a version below 7.0.3 for debian testing [KnownVersionIncompatibilityError]', async () => {
728+
const du = new MongoBinaryDownloadUrl({
729+
platform: 'linux',
730+
arch: 'x64',
731+
version: '7.0.2',
678732
os: {
679733
os: 'linux',
680734
dist: 'debian',

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@ exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for debian should thr
1010
Mongodb does not provide binaries for versions before 4.2.1 for Debian 10+ and also cannot be mapped to a previous Debian release"
1111
`;
1212

13-
exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for debian should throw a Error when requesting a version below 4.2.1 for debian testing [KnownVersionIncompatibilityError] 1`] = `
14-
"Requested Version \\"4.0.25\\" is not available for \\"Debian trixie\\"! Available Versions: \\">=4.2.1\\"
15-
Mongodb does not provide binaries for versions before 4.2.1 for Debian 10+ and also cannot be mapped to a previous Debian release"
13+
exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for debian should throw a Error when requesting a version below 7.0.3 for debian testing [KnownVersionIncompatibilityError] 1`] = `
14+
"Requested Version \\"7.0.2\\" is not available for \\"Debian trixie\\"! Available Versions: \\">=7.0.3\\"
15+
Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release"
1616
`;
1717

1818
exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for debian should throw a Error when the provided version could not be coerced [UnknownVersionError] 1`] = `"Could not coerce VERSION to a semver version (version: \\"vvv\\")"`;
1919

20+
exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for debian should throw an error when requesting a version below 7.0.3 for debian 12+ [#797] [KnownVersionIncompatibilityError] 1`] = `
21+
"Requested Version \\"7.0.2\\" is not available for \\"Debian 12\\"! Available Versions: \\">=7.0.3\\"
22+
Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release"
23+
`;
24+
2025
exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for rhel should Error when ARM64 and rhel below 8 [KnownVersionIncompatibilityError] 1`] = `
2126
"Requested Version \\"4.4.2\\" is not available for \\"Rhel 7 arm64\\"! Available Versions: \\">=4.4.2\\"
2227
ARM64(aarch64) support for rhel is only for rhel82 or higher"

packages/mongodb-memory-server-global-4.0/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-memory-server-global-4.0",
3-
"version": "9.1.6-beta.1",
3+
"version": "9.1.8",
44
"mongodb_version": "4.0.28",
55
"description": "MongoDB Server for testing (auto-download 4.0 version to ~/.cache/mongodb-binaries).",
66
"main": "index.js",
@@ -25,7 +25,7 @@
2525
"mongomem"
2626
],
2727
"dependencies": {
28-
"mongodb-memory-server-core": "9.1.6-beta.1",
28+
"mongodb-memory-server-core": "9.1.8",
2929
"tslib": "^2.6.2"
3030
},
3131
"scripts": {

packages/mongodb-memory-server-global-4.2/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-memory-server-global-4.2",
3-
"version": "9.1.6-beta.1",
3+
"version": "9.1.8",
44
"mongodb_version": "4.2.23",
55
"description": "MongoDB Server for testing (auto-download 4.2 version to ~/.cache/mongodb-binaries).",
66
"main": "index.js",
@@ -25,7 +25,7 @@
2525
"mongomem"
2626
],
2727
"dependencies": {
28-
"mongodb-memory-server-core": "9.1.6-beta.1",
28+
"mongodb-memory-server-core": "9.1.8",
2929
"tslib": "^2.6.2"
3030
},
3131
"scripts": {

packages/mongodb-memory-server-global-4.4/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-memory-server-global-4.4",
3-
"version": "9.1.6-beta.1",
3+
"version": "9.1.8",
44
"mongodb_version": "4.4.22",
55
"description": "MongoDB Server for testing (auto-download 4.4 version to ~/.cache/mongodb-binaries).",
66
"main": "index.js",
@@ -25,7 +25,7 @@
2525
"mongomem"
2626
],
2727
"dependencies": {
28-
"mongodb-memory-server-core": "9.1.6-beta.1",
28+
"mongodb-memory-server-core": "9.1.8",
2929
"tslib": "^2.6.2"
3030
},
3131
"scripts": {

packages/mongodb-memory-server-global/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-memory-server-global",
3-
"version": "9.1.6-beta.1",
3+
"version": "9.1.8",
44
"description": "MongoDB Server for testing (auto-download latest version to ~/.cache/mongodb-binaries).",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -24,7 +24,7 @@
2424
"mongomem"
2525
],
2626
"dependencies": {
27-
"mongodb-memory-server-core": "9.1.6-beta.1",
27+
"mongodb-memory-server-core": "9.1.8",
2828
"tslib": "^2.6.2"
2929
},
3030
"scripts": {

packages/mongodb-memory-server/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mongodb-memory-server",
3-
"version": "9.1.6-beta.1",
3+
"version": "9.1.8",
44
"description": "MongoDB Server for testing (auto-download latest version). The server will allow you to connect your favourite ODM or client library to the MongoDB Server and run parallel integration tests isolated from each other.",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -24,7 +24,7 @@
2424
"mongomem"
2525
],
2626
"dependencies": {
27-
"mongodb-memory-server-core": "9.1.6-beta.1",
27+
"mongodb-memory-server-core": "9.1.8",
2828
"tslib": "^2.6.2"
2929
},
3030
"scripts": {

0 commit comments

Comments
 (0)