Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Apr 19, 2024
2 parents fc59ea4 + fdf3d64 commit 219ed36
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: Load MongoDB binary cache
id: cache-mongodb-binaries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.cache/mongodb-binaries
key: ${{ matrix.node-version }}
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
## [9.1.8](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.7...v9.1.8) (2024-03-28)


### Fixes

* **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))

## [9.1.7](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.6...v9.1.7) (2024-03-11)


### Fixes

* **MongoBinaryDownloadUrl:** spelling mistake ([#854](https://github.com/nodkz/mongodb-memory-server/issues/854)) ([31ae840](https://github.com/nodkz/mongodb-memory-server/commit/31ae8403dddd2ac0bd82cffdde5a95aa74fa2e31))

## [9.1.6](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.5...v9.1.6) (2024-01-17)


### Fixes

* **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)
* **MongoBinaryDownloadUrl:** support elementaryos 7 ([064c69e](https://github.com/nodkz/mongodb-memory-server/commit/064c69e860514047fe0a6a12648a00648362d51a))
* **MongoBinaryDownloadUrl:** support linux-mint 21 ([e756164](https://github.com/nodkz/mongodb-memory-server/commit/e7561647bef9fa0fe490e797134d003e03b9d362))

## [9.1.6-beta.1](https://github.com/nodkz/mongodb-memory-server/compare/v9.1.5...v9.1.6-beta.1) (2024-01-17)


Expand Down
4 changes: 2 additions & 2 deletions docs/guides/supported-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ See [this mongodb issue](https://jira.mongodb.org/browse/SERVER-62300).

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

### Fedora

Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-memory-server-core",
"version": "9.1.6-beta.1",
"version": "9.1.8",
"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.",
"main": "lib/index",
"types": "lib/index.d.ts",
Expand Down Expand Up @@ -46,7 +46,7 @@
"camelcase": "^6.3.0",
"debug": "^4.3.4",
"find-cache-dir": "^3.3.2",
"follow-redirects": "^1.15.3",
"follow-redirects": "^1.15.6",
"https-proxy-agent": "^7.0.2",
"mongodb": "^5.9.1",
"new-find-package-json": "^2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
} else if (regexHelper(/debian/i, os)) {
return this.getDebianVersionString(os);
} else if (regexHelper(/alpine/i, os)) {
console.warn('There is no offical build of MongoDB for Alpine!');
console.warn('There is no official build of MongoDB for Alpine!');
// Match "arch", "archlinux", "manjaro", "manjarolinux", "arco", "arcolinux"
} else if (regexHelper(/(arch|manjaro|arco)(?:linux)?$/i, os)) {
console.warn(
Expand Down Expand Up @@ -286,7 +286,9 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
// see https://tracker.debian.org/news/1433360/accepted-base-files-13-source-into-unstable/
const isTesting = ['unstable', 'testing', ''].includes(os.release);

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

if (isTesting || release >= 10) {
if (isTesting || release >= 12) {
if (semver.lt(coercedVersion, '7.0.3') && !testVersionIsLatest(this.version)) {
throw new KnownVersionIncompatibilityError(
`Debian ${release || os.release || os.codename}`,
this.version,
'>=7.0.3',
'Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release'
);
}
} else if (release >= 10) {
if (semver.lt(coercedVersion, '4.2.1') && !testVersionIsLatest(this.version)) {
throw new KnownVersionIncompatibilityError(
`Debian ${release || os.release || os.codename}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,22 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for debian 12 for 7.0.3', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '7.0.3',
os: {
os: 'linux',
dist: 'debian',
release: '12',
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.3.tgz'
);
});

it('should allow v5.0-latest', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
Expand All @@ -576,15 +592,15 @@ describe('MongoBinaryDownloadUrl', () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '5.0.9',
version: '7.0.3',
os: {
os: 'linux',
dist: 'debian',
release: '',
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian11-5.0.9.tgz'
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-7.0.3.tgz'
);
});

Expand Down Expand Up @@ -670,11 +686,49 @@ describe('MongoBinaryDownloadUrl', () => {
}
});

it('should throw a Error when requesting a version below 4.2.1 for debian testing [KnownVersionIncompatibilityError]', async () => {
it('should throw an error when requesting a version below 7.0.3 for debian 12+ [#797] [KnownVersionIncompatibilityError]', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '4.0.25',
version: '7.0.2',
os: {
os: 'linux',
dist: 'debian',
release: '12',
},
});

try {
await du.getDownloadUrl();
fail('Expected to throw a KnownVersionIncompatibilityError');
} catch (err) {
assertIsError(err);
expect(err).toBeInstanceOf(KnownVersionIncompatibilityError);
expect(err.message).toMatchSnapshot();
}
});

it('should not throw an error for v7.0-latest for debian 12', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: 'v7.0-latest',
os: {
os: 'linux',
dist: 'debian',
release: '12',
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-debian12-v7.0-latest.tgz'
);
});

it('should throw a Error when requesting a version below 7.0.3 for debian testing [KnownVersionIncompatibilityError]', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '7.0.2',
os: {
os: 'linux',
dist: 'debian',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for debian should thr
Mongodb does not provide binaries for versions before 4.2.1 for Debian 10+ and also cannot be mapped to a previous Debian release"
`;

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

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\\")"`;

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`] = `
"Requested Version \\"7.0.2\\" is not available for \\"Debian 12\\"! Available Versions: \\">=7.0.3\\"
Mongodb does not provide binaries for versions before 7.0.3 for Debian 12+ and also cannot be mapped to a previous Debian release"
`;

exports[`MongoBinaryDownloadUrl getDownloadUrl() for linux for rhel should Error when ARM64 and rhel below 8 [KnownVersionIncompatibilityError] 1`] = `
"Requested Version \\"4.4.2\\" is not available for \\"Rhel 7 arm64\\"! Available Versions: \\">=4.4.2\\"
ARM64(aarch64) support for rhel is only for rhel82 or higher"
Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server-global-4.0/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-memory-server-global-4.0",
"version": "9.1.6-beta.1",
"version": "9.1.8",
"mongodb_version": "4.0.28",
"description": "MongoDB Server for testing (auto-download 4.0 version to ~/.cache/mongodb-binaries).",
"main": "index.js",
Expand All @@ -25,7 +25,7 @@
"mongomem"
],
"dependencies": {
"mongodb-memory-server-core": "9.1.6-beta.1",
"mongodb-memory-server-core": "9.1.8",
"tslib": "^2.6.2"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server-global-4.2/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-memory-server-global-4.2",
"version": "9.1.6-beta.1",
"version": "9.1.8",
"mongodb_version": "4.2.23",
"description": "MongoDB Server for testing (auto-download 4.2 version to ~/.cache/mongodb-binaries).",
"main": "index.js",
Expand All @@ -25,7 +25,7 @@
"mongomem"
],
"dependencies": {
"mongodb-memory-server-core": "9.1.6-beta.1",
"mongodb-memory-server-core": "9.1.8",
"tslib": "^2.6.2"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server-global-4.4/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-memory-server-global-4.4",
"version": "9.1.6-beta.1",
"version": "9.1.8",
"mongodb_version": "4.4.22",
"description": "MongoDB Server for testing (auto-download 4.4 version to ~/.cache/mongodb-binaries).",
"main": "index.js",
Expand All @@ -25,7 +25,7 @@
"mongomem"
],
"dependencies": {
"mongodb-memory-server-core": "9.1.6-beta.1",
"mongodb-memory-server-core": "9.1.8",
"tslib": "^2.6.2"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server-global/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-memory-server-global",
"version": "9.1.6-beta.1",
"version": "9.1.8",
"description": "MongoDB Server for testing (auto-download latest version to ~/.cache/mongodb-binaries).",
"main": "index.js",
"types": "index.d.ts",
Expand All @@ -24,7 +24,7 @@
"mongomem"
],
"dependencies": {
"mongodb-memory-server-core": "9.1.6-beta.1",
"mongodb-memory-server-core": "9.1.8",
"tslib": "^2.6.2"
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/mongodb-memory-server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongodb-memory-server",
"version": "9.1.6-beta.1",
"version": "9.1.8",
"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.",
"main": "index.js",
"types": "index.d.ts",
Expand All @@ -24,7 +24,7 @@
"mongomem"
],
"dependencies": {
"mongodb-memory-server-core": "9.1.6-beta.1",
"mongodb-memory-server-core": "9.1.8",
"tslib": "^2.6.2"
},
"scripts": {
Expand Down

0 comments on commit 219ed36

Please sign in to comment.