Skip to content

Commit 372f514

Browse files
committed
Merge branch 'master' into beta
2 parents d8a8a4a + a621f5d commit 372f514

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+5086
-5019
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Make sure you read [Mastering-Markdown](https://guides.github.com/features/maste
1313
## Versions
1414

1515
- NodeJS: 0.0.0
16-
- mongodb-memory-server-*: 0.0.0
16+
- mongodb-memory-server-*: 0.0.0 <!--"latest" is not a version-->
1717
- mongodb(the binary version): 0.0.0
18+
- mongodb(the js package): 0.0.0
1819
- mongoose: 0.0.0 <!--remove this if not used-->
1920
- system: <!--either Windows, MacOS, Linux (with distro and distro version)-->
2021

.github/ISSUE_TEMPLATE/question.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Make sure you read [Mastering-Markdown](https://guides.github.com/features/maste
1313
## Versions
1414

1515
- NodeJS: 0.0.0
16-
- mongodb-memory-server-*: 0.0.0
17-
- mongodb: 0.0.0
16+
- mongodb-memory-server-*: 0.0.0 <!--"latest" is not a version-->
17+
- mongodb(the binary version): 0.0.0
18+
- mongodb(the js package): 0.0.0
1819
- mongoose: 0.0.0 <!--remove this if not used-->
1920
- system: <!--either Windows, MacOS, Linux (with distro and distro version)-->
2021

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
uses: codecov/codecov-action@v2
4949

5050
publish:
51-
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta'
51+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta' || startsWith(github.ref, 'refs/heads/old')
5252
needs: [tests]
5353
runs-on: ubuntu-latest
5454
steps:

.releaserc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,13 @@ module.exports = {
106106
}],
107107
"@semantic-release/github"
108108
],
109+
branches: [
110+
// from what i read in the semantic-release configuration and in some issues, the order has to be like this:
111+
// other branches
112+
// main / upstream branch
113+
// prerelease branches
114+
{ name: "old\\/(\\d+)(\\.x)", range: "${name.replace(/^old\\//g, '')}", prerelease: false },
115+
"master",
116+
{ name: "beta", prerelease: true }
117+
]
109118
};

CHANGELOG.md

Lines changed: 224 additions & 2 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ And one of those (on Linux):
7878
- having an `/etc/*-release` file that is compliant to the [OS-Release Spec](https://www.freedesktop.org/software/systemd/man/os-release.html) (and does not include `lsb`)
7979
- manually specify which version & system should be used
8080

81+
On Linux, you will also need `libcurl4` (or `libcurl3` on some older distro versions). This will probably only be an issue on "slim" Docker images.
82+
8183
### Choose the Correct Package
8284

8385
[Choose the right package for the task](https://nodkz.github.io/mongodb-memory-server/docs/guides/quick-start-guide#choose-the-right-package)
@@ -225,7 +227,7 @@ For additional information it is recommended to read this article [Testing a Gra
225227

226228
### Test Runner Examples
227229

228-
[Documentation for Integration Examples](https://nodkz.github.io/mongodb-memory-server/docs/guides/integration-examples)
230+
[Documentation for Test Runner Integration Examples](https://nodkz.github.io/mongodb-memory-server/docs/guides/integration-examples/test-runners)
229231

230232
### Docker Alpine
231233

docs/api/classes/mongo-memory-replset.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Typings: `getUri(otherDb?: string): string`
4545

4646
Get an mongodb-usable uri (can also be used in mongoose)
4747

48+
When no arguments are set, the URI will always use ip `127.0.0.1` and end with `/?replicaSet=ReplSetName` (not setting a database).
49+
When setting `otherDbName`, the value of `otherDbName` will be appended after `/` and before any query arguments.
50+
When setting `otherIp`, the ip will be the value of `otherIp` instead of `127.0.0.1` (for all instances).
51+
4852
### start
4953

5054
Typings: `async start(): Promise<void>`
@@ -73,21 +77,23 @@ Ensures and returns that [`_keyfiletmp`](#_keyfiletmp) is defined an exists and
7377

7478
### stop
7579

76-
Typings: `async stop(runCleanup: boolean = true): Promise<boolean>`
80+
Typings: `async stop(cleanupOptions?: Cleanup): Promise<boolean>`
7781

78-
Stop an running instance
82+
Stop an running instance, this function will by default call [`.cleanup`](#cleanup) with `{ doCleanup: true, force: false }`.
7983

80-
This function will by default run [`.cleanup`](#cleanup), this must be set to `false` to be able to restart (and an engine other than `ephemeralForTest` must be used)
84+
With `cleanupOptions` options for cleanup can be manually set.
8185

8286
:::caution
8387
Will not Error if instance is not running
8488
:::
8589

8690
### cleanup
8791

88-
Typings: `async cleanup(force: boolean = false): Promise<void>`
92+
Typings: `async cleanup(options?: Cleanup): Promise<void>`
93+
94+
Cleanup all files used by this ReplSet's instances, by default `{ doCleanup: true, force: false }` is used.
8995

90-
Cleanup all files used by this ReplSet & instances
96+
With `options` can be set how to run a cleanup.
9197

9298
### waitUntilRunning
9399

docs/api/classes/mongo-memory-server.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Typings: `async start(forceSamePort: boolean = false): Promise<boolean>`
3737

3838
Used to start an new Instance or to Re-Start an stopped instance
3939

40+
with `forceSamePort` set to `true` and having `instance.port` set, it will use that port and not generate a new port.
41+
with `forceSamePort` set to `true` and not having `instance.port` set, it will generate a new free port.
42+
4043
:::caution
4144
Will Error if instance is already running
4245
:::
@@ -53,7 +56,10 @@ Finds an new non-locked port
5356

5457
<span class="badge badge--warning">Internal</span>
5558

56-
Typings: `protected async getStartOptions(): Promise<MongoMemoryServerGetStartOptions>`
59+
Typings: `protected async getStartOptions(forceSamePort: boolean = false): Promise<MongoMemoryServerGetStartOptions>`
60+
61+
with `forceSamePort` set to `true` and having `instance.port` set, it will use that port and not generate a new port.
62+
with `forceSamePort` set to `true` and not having `instance.port` set, it will generate a new free port.
5763

5864
Constructs the Starting Options
5965

@@ -67,19 +73,23 @@ Internal Functions used by [`start`](#start)
6773

6874
### stop
6975

70-
Typings: `async stop(runCleanup: boolean = true): Promise<boolean>`
76+
Typings: `async stop(cleanupOptions?: Cleanup): Promise<boolean>`
77+
78+
Stop an running instance, this function will by default call [`.cleanup`](#cleanup) with `{ doCleanup: true, force: false }`.
7179

72-
Stop an running instance
80+
With `cleanupOptions` options for cleanup can be manually set.
7381

7482
:::caution
7583
Will not Error if instance is not running
7684
:::
7785

7886
### cleanup
7987

80-
Typings: `async cleanup(force: boolean): Promise<void>`
88+
Typings: `async cleanup(options?: Cleanup): Promise<void>`
8189

82-
Cleanup all files used by this instance
90+
Cleanup all files used by this instance, by default `{ doCleanup: true, force: false }` is used.
91+
92+
With `options` can be set how to run a cleanup.
8393

8494
### ensureInstance
8595

@@ -93,10 +103,14 @@ Will Error if instance cannot be started
93103

94104
### getUri
95105

96-
Typings: `getUri(otherDbName?: string): string`
106+
Typings: `getUri(otherDbName?: string, otherIp?: string): string`
97107

98108
Get an mongodb-usable uri (can also be used in mongoose)
99109

110+
When no arguments are set, the URI will always use ip `127.0.0.1` and end with `/` (not setting a database).
111+
When setting `otherDbName`, the value of `otherDbName` will be appended after `/` and before any query arguments.
112+
When setting `otherIp`, the ip will be the value of `otherIp` instead of `127.0.0.1`.
113+
100114
### createAuth
101115

102116
<span class="badge badge--warning">Internal</span>

docs/api/config-options.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ Search for what version is used:
5353
- [`windows`](https://www.mongodb.org/dl/win32)
5454
- [`linux`](https://dl.mongodb.org/dl/linux)
5555

56+
:::note
57+
When using [`SYSTEM_BINARY`](#system_binary) and [`SYSTEM_BINARY_VERSION_CHECK`](#system_binary_version_check), ONLY the major, minor, and patch versions of the system binary will be compared against the desired binary.
58+
59+
That is, a system binary version of `4.2.19-11-ge2f2736a` will match a mongodb required version of `4.2.19`. DO NOT set the mongodb required version to the full `4.2.19-11-ge2f2736a` version as the check which examines the binary version will strip the additional tags.
60+
:::
61+
5662
### DEBUG
5763

5864
Option `DEBUG` is used to enable Debug Output
File renamed without changes.

0 commit comments

Comments
 (0)