Skip to content

Commit

Permalink
test: fix bunyan test
Browse files Browse the repository at this point in the history
  • Loading branch information
abhilash-sivan committed Dec 19, 2024
1 parent cde7f0a commit f925c7b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
14 changes: 3 additions & 11 deletions packages/collector/test/tracing/logger/bunyan/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ process.on('SIGTERM', () => {
process.exit(0);
});

const agentPort = process.env.AGENT_PORT;

const instana = require('../../../..');
instana({
agentPort,
level: 'warn',
tracing: {
enabled: process.env.TRACING_ENABLED !== 'false',
forceTransmissionStartingAt: 1
}
});
require('../../../..')();

const fetch = require('node-fetch-v2');
const bodyParser = require('body-parser');
Expand All @@ -35,6 +25,8 @@ const path = require('path');
const bunyan = require('bunyan');
const logger = bunyan.createLogger({ name: 'test-logger' });

const agentPort = process.env.INSTANA_AGENT_PORT;

const app = express();
const logPrefix = `Bunyan (${process.pid}):\t`;

Expand Down
5 changes: 2 additions & 3 deletions packages/collector/test/tracing/logger/bunyan/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const testUtils = require('../../../../../core/test/test_util');
const globalAgent = require('../../../globalAgent');
const ProcessControls = require('../../../test_util/ProcessControls');

// Skip for now. correct it later
const mochaSuiteFn = supportedVersion(process.versions.node) ? describe.skip : describe.skip;
const mochaSuiteFn = supportedVersion(process.versions.node) ? describe : describe.skip;

mochaSuiteFn('tracing/logger/bunyan', function () {
this.timeout(config.getTestTimeout());
Expand Down Expand Up @@ -74,7 +73,7 @@ mochaSuiteFn('tracing/logger/bunyan', function () {
runTest('error-object-only', true, 'This is an error.', controls));

it("must capture a nested error object's message", async () => {
await runTest('nested-error-object-only', true, 'This is a nested error.');
await runTest('nested-error-object-only', true, 'This is a nested error.', controls);
});

it('must serialize random object', () => runTest('error-random-object-only', true, '{"foo":"[Object]"}', controls));
Expand Down

0 comments on commit f925c7b

Please sign in to comment.