Skip to content

Commit 2a6ea19

Browse files
authored
tests: fix tests to work with recent elastic-apm-node that includes a log preamble (#148)
Since [email protected] the APM agent will log.info a preamble with config and some other basic debugging info. This was breaking the APM-related tests.
1 parent 08cbec4 commit 2a6ea19

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

loggers/morgan/test/serve-one-http-req-with-apm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ const apm = require('elastic-apm-node').start({
3636
serviceName: 'test-apm',
3737
centralConfig: false,
3838
captureExceptions: false,
39-
metricsInterval: 0,
40-
apmServerVersion: '8.2.0' // avoid APM server version check request
39+
metricsInterval: '0s',
40+
apmServerVersion: '8.9.0', // avoid APM server version check request
41+
logLevel: 'warn' // avoid APM agent log preamble
4142
})
4243

4344
const app = require('express')()

loggers/pino/test/serve-one-http-req-with-apm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ const apm = require('elastic-apm-node').start({
3535
serviceName: 'test-apm',
3636
centralConfig: false,
3737
captureExceptions: false,
38-
metricsInterval: 0,
39-
apmServerVersion: '8.2.0' // avoid APM server version check request
38+
metricsInterval: '0s',
39+
apmServerVersion: '8.9.0', // avoid APM server version check request
40+
logLevel: 'warn' // avoid APM agent log preamble
4041
})
4142

4243
const http = require('http')

loggers/winston/test/serve-one-http-req-with-apm.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ const apm = require('elastic-apm-node').start({
3535
serviceName: 'test-apm',
3636
centralConfig: false,
3737
captureExceptions: false,
38-
metricsInterval: 0,
39-
apmServerVersion: '8.2.0' // avoid APM server version check request
38+
metricsInterval: '0s',
39+
apmServerVersion: '8.9.0', // avoid APM server version check request
40+
logLevel: 'warn' // avoid APM agent log preamble
4041
})
4142

4243
const http = require('http')

0 commit comments

Comments
 (0)