mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
[misc] silence logger when running tests (#22243)
* [misc] silence logger when running tests * [misc] re-enable logging in some tests for scripts * [misc] make it easy to turn on verbose logging for tests ``` LOG_LEVEL=debug make test_unit LOG_LEVEL=debug make test_acceptance ``` GitOrigin-RevId: 219bc6d1f9cbdb89ddd7d94742920913ddde4514
This commit is contained in:
@@ -17,6 +17,7 @@ services:
|
||||
environment:
|
||||
BASE_CONFIG:
|
||||
OVERLEAF_CONFIG:
|
||||
NODE_ENV: test
|
||||
NODE_OPTIONS: "--unhandled-rejections=strict"
|
||||
depends_on:
|
||||
- mongo
|
||||
|
||||
@@ -17,6 +17,8 @@ services:
|
||||
BASE_CONFIG:
|
||||
OVERLEAF_CONFIG:
|
||||
MOCHA_GREP: ${MOCHA_GREP}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-}
|
||||
NODE_ENV: test
|
||||
NODE_OPTIONS: "--unhandled-rejections=strict"
|
||||
command: npm run --silent test:unit:app
|
||||
user: node
|
||||
@@ -36,6 +38,7 @@ services:
|
||||
BASE_CONFIG:
|
||||
OVERLEAF_CONFIG:
|
||||
MOCHA_GREP: ${MOCHA_GREP}
|
||||
LOG_LEVEL: ${LOG_LEVEL:-}
|
||||
MONGO_SERVER_SELECTION_TIMEOUT: 600000
|
||||
MONGO_SOCKET_TIMEOUT: 300000
|
||||
# OVERLEAF_ALLOW_ANONYMOUS_READ_AND_WRITE_SHARING: 'true'
|
||||
|
||||
@@ -19,6 +19,10 @@ function run(cmd) {
|
||||
// Pipe stdin from /dev/null, store stdout, pipe stderr to /dev/null.
|
||||
return execSync(cmd, {
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
env: {
|
||||
...process.env,
|
||||
LOG_LEVEL: 'warn',
|
||||
},
|
||||
}).toString()
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import App from '../../../../app.mjs'
|
||||
import QueueWorkers from '../../../../app/src/infrastructure/QueueWorkers.js'
|
||||
import MongoHelper from './MongoHelper.mjs'
|
||||
import RedisHelper from './RedisHelper.mjs'
|
||||
import logger from '@overleaf/logger'
|
||||
import Settings from '@overleaf/settings'
|
||||
import MockReCAPTCHAApi from '../mocks/MockReCaptchaApi.mjs'
|
||||
import { gracefulShutdown } from '../../../../app/src/infrastructure/GracefulShutdown.js'
|
||||
@@ -14,8 +13,6 @@ import Modules from '../../../../app/src/infrastructure/Modules.js'
|
||||
|
||||
const app = Server.app
|
||||
|
||||
logger.logger.level('error')
|
||||
|
||||
MongoHelper.initialize()
|
||||
RedisHelper.initialize()
|
||||
MockReCAPTCHAApi.initialize(2222)
|
||||
|
||||
Reference in New Issue
Block a user