Skip to content

Commit 9baf8c1

Browse files
committed
Merge remote-tracking branch 'origin/main' into MONGOSH-1090-get-log-path
2 parents 72cc761 + 3c085d2 commit 9baf8c1

File tree

13 files changed

+165
-61
lines changed

13 files changed

+165
-61
lines changed

.evergreen/setup-env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ fi
1313
export BASEDIR="$PWD/.evergreen"
1414
export PATH="/cygdrive/c/python/Python311/Scripts:/cygdrive/c/python/Python311:/cygdrive/c/Python311/Scripts:/cygdrive/c/Python311:/opt/python/3.6/bin:$BASEDIR/mingit/cmd:$BASEDIR/mingit/mingw64/libexec/git-core:$BASEDIR/git-2:$BASEDIR/npm-10/node_modules/.bin:$BASEDIR/node-v$NODE_JS_VERSION-win-x64:/opt/java/jdk16/bin:/opt/chefdk/gitbin:/cygdrive/c/cmake/bin:$TOOLCHAIN_PATH:$PATH"
1515

16-
export MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT=100000
16+
export MONGOSH_GLOBAL_CONFIG_FILE_FOR_TESTING="$BASEDIR/../../testing/tests-globalconfig.conf"
17+
1718
export IS_MONGOSH_EVERGREEN_CI=1
1819
export DEBUG="mongodb*,$DEBUG"
1920

THIRD_PARTY_NOTICES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ Package|Version|License
333333
**[mongodb-client-encryption](#d8efb4ae363035b677f38203b1acc7b0d69b22f13b17e95d09d151bf9928072a)**|6.1.1|Apache-2.0
334334
**[mongodb-connection-string-url](#2e1146256a89ebd24e3398881e03807fe363d58444e6b7952ea50bd6108707bc)**|3.0.1|Apache-2.0
335335
**[mongodb-crypt-library-version](#003bd2892d6f6fdac0613ba8f9a2fbb054ddd1c26901e1d2fc7e83861b21cf4d)**|1.0.5|Apache-2.0
336-
**[mongodb-log-writer](#aa6af6c54190e5547bd195c110196863c35a7ecb8f24c593f9f1d9cde3db9f16)**|2.1.0|Apache-2.0
336+
**[mongodb-log-writer](#0ea266b0fdd89dc0e20fe8fce081aaceb79e60918c606b3ab6e8b3978aa36ab5)**|2.3.0|Apache-2.0
337337
**[mongodb-redact](#6fe8cef9beca5f3e1e3e999f47975ae99dcf4488419b28fc6d5eafc436081623)**|1.1.5|Apache-2.0
338338
**[mongodb](#cb726cf7a5329fc15d51574a4bc2e29682afe46afb788a94370b09643ab98a72)**|6.12.0|Apache-2.0
339339
**[ms](#484b814b85d5028e34246147c8fc901d33570202bd7cdc3703c0ed1078eba0aa)**|2.0.0|MIT
@@ -27372,8 +27372,8 @@ License files:
2737227372

2737327373

2737427374

27375-
<a id="aa6af6c54190e5547bd195c110196863c35a7ecb8f24c593f9f1d9cde3db9f16"></a>
27376-
### [mongodb-log-writer](https://www.npmjs.com/package/mongodb-log-writer) (version 2.1.0)
27375+
<a id="0ea266b0fdd89dc0e20fe8fce081aaceb79e60918c606b3ab6e8b3978aa36ab5"></a>
27376+
### [mongodb-log-writer](https://www.npmjs.com/package/mongodb-log-writer) (version 2.3.0)
2737727377
License tags: Apache-2.0
2737827378

2737927379
License files:

package-lock.json

Lines changed: 41 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli-repl/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@
8585
"is-recoverable-error": "^1.0.3",
8686
"js-yaml": "^4.1.0",
8787
"mongodb-connection-string-url": "^3.0.1",
88-
"mongodb-log-writer": "^2.1.0",
88+
"mongodb-log-writer": "^2.3.0",
8989
"numeral": "^2.0.6",
9090
"pretty-repl": "^4.0.1",
9191
"semver": "^7.5.4",

packages/cli-repl/src/cli-repl.spec.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ describe('CliRepl', function () {
326326
'logRetentionDays',
327327
'logMaxFileCount',
328328
'logCompressionEnabled',
329+
'logRetentionGB',
329330
] satisfies (keyof CliUserConfig)[]);
330331
});
331332

@@ -1477,12 +1478,22 @@ describe('CliRepl', function () {
14771478
);
14781479
});
14791480

1481+
it('can set log retention GB', async function () {
1482+
const testLogRetentionGB = 10;
1483+
cliRepl.config.logRetentionGB = testLogRetentionGB;
1484+
await cliRepl.start(await testServer.connectionString(), {});
1485+
1486+
expect(await cliRepl.getConfig('logRetentionGB')).equals(
1487+
testLogRetentionGB
1488+
);
1489+
expect(cliRepl.logManager?._options.retentionGB).equals(
1490+
testLogRetentionGB
1491+
);
1492+
});
1493+
14801494
it('can set log max file count', async function () {
14811495
const testMaxFileCount = 123;
14821496
cliRepl.config.logMaxFileCount = testMaxFileCount;
1483-
const oldEnvironmentLimit =
1484-
process.env.MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT;
1485-
delete process.env.MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT;
14861497
await cliRepl.start(await testServer.connectionString(), {});
14871498

14881499
expect(await cliRepl.getConfig('logMaxFileCount')).equals(
@@ -1491,9 +1502,6 @@ describe('CliRepl', function () {
14911502
expect(cliRepl.logManager?._options.maxLogFileCount).equals(
14921503
testMaxFileCount
14931504
);
1494-
1495-
process.env.MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT =
1496-
oldEnvironmentLimit;
14971505
});
14981506

14991507
it('can set log compression', async function () {

packages/cli-repl/src/cli-repl.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,8 @@ export class CliRepl implements MongoshIOProvider {
268268
this.shellHomeDirectory.localPath('.'),
269269
retentionDays: await this.getConfig('logRetentionDays'),
270270
gzip: await this.getConfig('logCompressionEnabled'),
271-
maxLogFileCount: +(
272-
process.env.MONGOSH_TEST_ONLY_MAX_LOG_FILE_COUNT ||
273-
(await this.getConfig('logMaxFileCount'))
274-
),
271+
maxLogFileCount: await this.getConfig('logMaxFileCount'),
272+
retentionGB: await this.getConfig('logRetentionGB'),
275273
onerror: (err: Error) => this.bus.emit('mongosh:error', err, 'log'),
276274
onwarn: (err: Error, path: string) =>
277275
this.warnAboutInaccessibleFile(err, path),

packages/e2e-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"strip-ansi": "^6.0.0"
3434
},
3535
"devDependencies": {
36-
"mongodb-log-writer": "^2.1.0",
36+
"mongodb-log-writer": "^2.3.0",
3737
"@mongodb-js/eslint-config-mongosh": "^1.0.0",
3838
"@mongodb-js/oidc-mock-provider": "^0.10.2",
3939
"@mongodb-js/prettier-config-devtools": "^1.0.1",

0 commit comments

Comments
 (0)