Skip to content

Commit

Permalink
feat(resolveConfig): update default binary version to 7.0.14
Browse files Browse the repository at this point in the history
from 7.0.11
  • Loading branch information
hasezoey committed Oct 9, 2024
1 parent 279497c commit 946e78e
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 28 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ On Linux, you will also need `libcurl4` (or `libcurl3` on some older distro vers

### Configuring which mongod binary to use

The default behavior is that version `7.0.11` for your OS will be downloaded. By setting [Environment variables](https://typegoose.github.io/mongodb-memory-server/docs/api/config-options) you are able to specify which version and binary will be downloaded:
The default behavior is that version `7.0.14` for your OS will be downloaded. By setting [Environment variables](https://typegoose.github.io/mongodb-memory-server/docs/api/config-options) you are able to specify which version and binary will be downloaded:

```sh
export MONGOMS_DOWNLOAD_URL=https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz
Expand Down Expand Up @@ -128,7 +128,7 @@ const mongod = new MongoMemoryServer({
auth?: boolean, // add "--auth" argument, dont use this directly use top-level "auth"
},
binary?: {
version?: string, // by default '7.0.11'
version?: string, // by default '7.0.14'
downloadDir?: string, // see the documentation on what is chosen by default https://typegoose.github.io/mongodb-memory-server/docs/api/config-options#download_dir
platform?: string, // by default os.platform()
arch?: string, // by default os.arch()
Expand Down
2 changes: 1 addition & 1 deletion docs/api/config-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Example: `ubuntu-18.04`

Option `VERSION` is used to set what mongodb version should be downloaded

Default: `7.0.11` (see [Mongodb Server Versions](../guides/mongodb-server-versions.md) for a complete list and policy)
Default: `7.0.14` (see [Mongodb Server Versions](../guides/mongodb-server-versions.md) for a complete list and policy)

This Option does not have a effect when [`ARCHIVE_NAME`](#archive_name) or [`DOWNLOAD_URL`](#download_url) is defined.

Expand Down
3 changes: 2 additions & 1 deletion docs/guides/mongodb-server-versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Starting with MongoDB version 5.0, the default versions for `mongodb-memory-serv

| `mongodb-memory-server-core` Version | Default MongoDB Version |
| :----------------------------------: | :---------------------: |
| 10.0.x - 10.0.x | 7.0.11 |
| 10.1.x - 10.1.x | 7.0.14 |
| 10.0.x - 10.0.x | 7.0.11 |
| 9.2.x - 9.2.x | 6.0.14 |
| 9.0.x - 9.1.x | 6.0.9 |
| 8.14.x - 8.16.x | 5.0.19 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ describe('MongoMemoryReplSet', () => {
describe('server version specific', () => {
// should use default options that are supported for 7.0 (like not using "ephemeralForTest" by default)
it('should allow mongodb by default 7.0', async () => {
const server = await MongoMemoryReplSet.create({ binary: { version: '7.0.11' } });
const server = await MongoMemoryReplSet.create({ binary: { version: '7.0.14' } });

await server.stop();
});
Expand All @@ -746,7 +746,7 @@ describe('MongoMemoryReplSet', () => {
it('should not warn if no explicit storage engine is set in 7.0', async () => {
jest.spyOn(console, 'warn');
const server = await MongoMemoryReplSet.create({
binary: { version: '7.0.11' },
binary: { version: '7.0.14' },
// replSet: { storageEngine: 'ephemeralForTest' },
});

Expand All @@ -760,7 +760,7 @@ describe('MongoMemoryReplSet', () => {
it('should warn if "ephemeralForTest" is used explicitly in mongodb 7.0', async () => {
const spy = jest.spyOn(console, 'warn').mockImplementationOnce(() => {});
const server = await MongoMemoryReplSet.create({
binary: { version: '7.0.11' },
binary: { version: '7.0.14' },
replSet: { storageEngine: 'ephemeralForTest' },
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ describe('MongoMemoryServer', () => {
describe('server version specific', () => {
// should use default options that are supported for 7.0 (like not using "ephemeralForTest" by default)
it('should allow mongodb by default 7.0', async () => {
const server = await MongoMemoryServer.create({ binary: { version: '7.0.11' } });
const server = await MongoMemoryServer.create({ binary: { version: '7.0.14' } });

await server.stop();
});
Expand All @@ -1266,7 +1266,7 @@ describe('MongoMemoryServer', () => {
it('should not warn if no explicit storage engine is set in 7.0', async () => {
jest.spyOn(console, 'warn');
const server = await MongoMemoryServer.create({
binary: { version: '7.0.11' },
binary: { version: '7.0.14' },
// instance: { storageEngine: 'ephemeralForTest' },
});

Expand All @@ -1280,7 +1280,7 @@ describe('MongoMemoryServer', () => {
it('should warn if "ephemeralForTest" is used explicitly in mongodb 7.0', async () => {
const spy = jest.spyOn(console, 'warn').mockImplementationOnce(() => {});
const server = await MongoMemoryServer.create({
binary: { version: '7.0.11' },
binary: { version: '7.0.14' },
instance: { storageEngine: 'ephemeralForTest' },
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export = async function globalSetup(): Promise<void> {
'4.4.28',
'5.0.19',
'6.0.14',
'7.0.11',
'7.0.14',
'8.0.1',
];
// Ensure all required versions are downloaded for tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,23 @@ describe('MongoBinaryDownloadUrl', () => {
const du = new MongoBinaryDownloadUrl({
platform: 'darwin',
arch: 'x64',
version: '7.0.11',
version: '7.0.14',
});

expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-7.0.11.tgz'
'https://fastdl.mongodb.org/osx/mongodb-macos-x86_64-7.0.14.tgz'
);
});

it('should work with mongodb 7.0 (arm64)', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'darwin',
arch: 'arm64',
version: '7.0.11',
version: '7.0.14',
});

expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/osx/mongodb-macos-arm64-7.0.11.tgz'
'https://fastdl.mongodb.org/osx/mongodb-macos-arm64-7.0.14.tgz'
);
});

Expand Down Expand Up @@ -333,35 +333,35 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

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

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

Expand Down Expand Up @@ -1162,10 +1162,10 @@ describe('MongoBinaryDownloadUrl', () => {

it('should return a archive name for Linux Mint 21', async () => {
(downloadUrl.os as LinuxOS).release = '22';
downloadUrl.version = '7.0.11';
downloadUrl.version = '7.0.14';
// NOTE: there are currently no binaries for ubuntu 24.04, but 22.04 still work
expect(await downloadUrl.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.11.tgz'
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-7.0.14.tgz'
);
});
});
Expand Down Expand Up @@ -1759,14 +1759,14 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('7.0.11 (windows)', async () => {
it('7.0.14 (windows)', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'win32',
arch: 'x64',
version: '7.0.11',
version: '7.0.14',
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-7.0.11.zip'
'https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-7.0.14.zip'
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe('MongodbInstance', () => {
const mongod = await MongodbInstance.create({
// this works without problems, because no explicit storage-engine is given, so mongodb automatically chooses wiredTiger
instance: { port: gotPort, dbPath: tmpDir },
binary: { version: '7.0.11' },
binary: { version: '7.0.14' },
});
expect(mongod.mongodProcess!.pid).toBeGreaterThan(0);
await mongod.stop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export enum ResolveConfigVariables {
/** The Prefix for Environmental values */
export const ENV_CONFIG_PREFIX = 'MONGOMS_';
/** This Value exists here, because "defaultValues" can be changed with "setDefaultValue", but this property is constant */
export const DEFAULT_VERSION = '7.0.11';
export const DEFAULT_VERSION = '7.0.14';
/** Default values for some config options that require explicit setting, it is constant so that the default values cannot be interfered with */
export const defaultValues = new Map<ResolveConfigVariables, string>([
// apply app-default values here
Expand Down

0 comments on commit 946e78e

Please sign in to comment.