Skip to content

Commit

Permalink
tests: fix tests to work with recent elastic-apm-node that includes a…
Browse files Browse the repository at this point in the history
… log preamble (#148)

Since elastic-apm-node@3.47.0 the APM agent will log.info a
preamble with config and some other basic debugging info.
This was breaking the APM-related tests.
  • Loading branch information
trentm authored Oct 4, 2023
1 parent 08cbec4 commit 2a6ea19
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions loggers/morgan/test/serve-one-http-req-with-apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ const apm = require('elastic-apm-node').start({
serviceName: 'test-apm',
centralConfig: false,
captureExceptions: false,
metricsInterval: 0,
apmServerVersion: '8.2.0' // avoid APM server version check request
metricsInterval: '0s',
apmServerVersion: '8.9.0', // avoid APM server version check request
logLevel: 'warn' // avoid APM agent log preamble
})

const app = require('express')()
Expand Down
5 changes: 3 additions & 2 deletions loggers/pino/test/serve-one-http-req-with-apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ const apm = require('elastic-apm-node').start({
serviceName: 'test-apm',
centralConfig: false,
captureExceptions: false,
metricsInterval: 0,
apmServerVersion: '8.2.0' // avoid APM server version check request
metricsInterval: '0s',
apmServerVersion: '8.9.0', // avoid APM server version check request
logLevel: 'warn' // avoid APM agent log preamble
})

const http = require('http')
Expand Down
5 changes: 3 additions & 2 deletions loggers/winston/test/serve-one-http-req-with-apm.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ const apm = require('elastic-apm-node').start({
serviceName: 'test-apm',
centralConfig: false,
captureExceptions: false,
metricsInterval: 0,
apmServerVersion: '8.2.0' // avoid APM server version check request
metricsInterval: '0s',
apmServerVersion: '8.9.0', // avoid APM server version check request
logLevel: 'warn' // avoid APM agent log preamble
})

const http = require('http')
Expand Down

0 comments on commit 2a6ea19

Please sign in to comment.