From 9f229535fa38843a72b7e20c93dfbbb82d111de0 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Tue, 15 Oct 2024 15:28:10 -0400 Subject: [PATCH 1/5] feat: Removed accessing transaction from segment --- lib/common.js | 21 +++++++++----------- lib/error-helper.js | 3 +-- lib/hooks.js | 34 +++++++++++++++++--------------- tests/unit/create-plugin.test.js | 3 +++ tests/unit/error-helper.test.js | 3 +++ 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/lib/common.js b/lib/common.js index 3c68e86..4f68ac3 100644 --- a/lib/common.js +++ b/lib/common.js @@ -82,13 +82,12 @@ function createResolverSegment({ shim, parent, resolver, formattedPath }) { * @param {Object} params.config plugin config * @param {Object} segment relevant resolver segment * @param {string} scope name of transaction + * @param {Transaction} transaction active transaction */ -function recordResolveSegment(segment, scope) { +function recordResolveSegment(segment, scope, transaction) { const duration = segment.getDurationInMillis() const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - const attributes = segment.getAttributes() const fieldName = attributes[FIELD_NAME_ATTR] const fieldType = attributes[PARENT_TYPE_ATTR] @@ -102,12 +101,10 @@ function recordResolveSegment(segment, scope) { } } -function recordOperationSegment(segment, scope) { +function recordOperationSegment(segment, scope, transaction) { const duration = segment.getDurationInMillis() const exclusive = segment.getExclusiveDurationInMillis() - const transaction = segment.transaction - createMetricPairs(transaction, segment.name, scope, duration, exclusive) } @@ -132,9 +129,10 @@ function createModuleUsageMetric(agent) { * * @param {Object} context apollo request context * @param {Segment} operationSegment default segment created in request start + * @param {Transaction} transaction active transaction * @return {Boolean} true if document could be parsed from context */ -function updateOperationSegmentName(context, operationSegment) { +function updateOperationSegmentName(context, operationSegment, transaction) { const operationDetails = getOperationDetails(context) if (operationDetails) { const { operationName, operationType, deepestUniquePath, cleanedQuery } = operationDetails @@ -157,7 +155,7 @@ function updateOperationSegmentName(context, operationSegment) { const segmentName = formattedOperation const transactionName = formattedOperation - setTransactionName(operationSegment.transaction, transactionName) + setTransactionName(transaction, transactionName) operationSegment.name = `${OPERATION_PREFIX}/${segmentName}` return true } @@ -172,14 +170,13 @@ function updateOperationSegmentName(context, operationSegment) { * * @param {Object} params * @param {Object} params.config plugin config - * @param {Object} params.info info key from resolver context - * @param {Object} params.operationSegment operation segment + * @param {Object} paramst.info info key from resolver context + * @param {Object} params.transaction active transaction * @param {Object} params.args args key from resolver context * */ -function maybeCaptureFieldMetrics({ config, info, operationSegment, args }) { +function maybeCaptureFieldMetrics({ config, info, transaction, args }) { if (config.captureFieldMetrics) { - const transaction = operationSegment.transaction const fieldName = info.fieldName const fieldType = info.parentType.toString() captureFieldMetrics({ transaction, args, fieldName, fieldType }) diff --git a/lib/error-helper.js b/lib/error-helper.js index f616171..ce50c04 100644 --- a/lib/error-helper.js +++ b/lib/error-helper.js @@ -30,8 +30,7 @@ class ErrorHelper { noticeError(instrumentationApi, error) { error = error.originalError || error - const activeSegment = instrumentationApi.getActiveSegment() - const transaction = activeSegment && activeSegment.transaction + const transaction = instrumentationApi.tracer.getTransaction() instrumentationApi.agent.errors.add(transaction, error, error.extensions) } } diff --git a/lib/hooks.js b/lib/hooks.js index b52f5f1..7b89474 100644 --- a/lib/hooks.js +++ b/lib/hooks.js @@ -43,6 +43,7 @@ module.exports = function requestDidStart({ api, shim, logger, config }, request logger.trace('Begin requestDidStart') const requestParent = shim.getActiveSegment() + const transaction = shim.tracer.getTransaction() if (!requestParent) { logger.trace('No active segment found at query start. Not recording.') @@ -60,10 +61,10 @@ module.exports = function requestDidStart({ api, shim, logger, config }, request return { didResolveOperation: didResolveOperation.bind(null, { - shim, config, logger, - operationSegment + operationSegment, + transaction }), didEncounterErrors: didEncounterErrors.bind(null, { shim, operationSegment }), executionDidStart() { @@ -79,7 +80,8 @@ module.exports = function requestDidStart({ api, shim, logger, config }, request config, logger, operationSegment, - requestContext + requestContext, + transaction }) } }, @@ -88,7 +90,8 @@ module.exports = function requestDidStart({ api, shim, logger, config }, request shim, config, logger, - operationSegment + operationSegment, + transaction }) } } @@ -104,14 +107,10 @@ module.exports = function requestDidStart({ api, shim, logger, config }, request * @param {TraceSegment} params.operationSegment the segment capturing the operation * @param {GraphQLRequestContext} requestContext context on operation resolution */ -function didResolveOperation({ shim, config, logger, operationSegment }, requestContext) { - updateOperationSegmentName(requestContext, operationSegment) +function didResolveOperation({ config, logger, operationSegment, transaction }, requestContext) { + updateOperationSegmentName(requestContext, operationSegment, transaction) if (shouldIgnoreTransaction(requestContext.operation, config, logger)) { - const activeSegment = shim.getActiveSegment() - if (activeSegment) { - const transaction = activeSegment.transaction - transaction.setForceIgnore(true) - } + transaction.setForceIgnore(true) } } @@ -146,7 +145,7 @@ function didEncounterErrors({ shim, operationSegment }, requestContext) { * @returns {Function} handler once field resolves, used to handle errors */ function willResolveField( - { api, shim, logger, config, operationSegment, requestContext }, + { api, shim, logger, config, operationSegment, requestContext, transaction }, resolverContext ) { const { info, args } = resolverContext @@ -154,7 +153,7 @@ function willResolveField( const formattedPath = pathArray.reverse().join('.') const flattenedArgs = flattenArgs({ obj: args }) - maybeCaptureFieldMetrics({ operationSegment, info, args: flattenedArgs, config }) + maybeCaptureFieldMetrics({ transaction, info, args: flattenedArgs, config }) if (!config.captureScalars && !isTopLevelField(info) && isScalar(info)) { return null @@ -237,13 +236,16 @@ function fieldResolver({ shim, requestContext, resolverSegment, currentSegment } * @param {TraceSegment} params.operationSegment the segment capturing the operation * @param {GraphQLRequestContext} requestContext context on operation resolution */ -function willSendResponse({ api, shim, config, logger, operationSegment }, requestContext) { +function willSendResponse( + { api, shim, config, logger, operationSegment, transaction }, + requestContext +) { // check if operation segment was never updated from default name // If so, try to rename before setting the transaction name to `*` if (operationSegment.name === DEFAULT_OPERATION_NAME) { - const updated = updateOperationSegmentName(requestContext, operationSegment) + const updated = updateOperationSegmentName(requestContext, operationSegment, transaction) if (!updated) { - setTransactionName(operationSegment.transaction, '*') + setTransactionName(transaction, '*') } } diff --git a/tests/unit/create-plugin.test.js b/tests/unit/create-plugin.test.js index 17264d9..d2a4bf2 100644 --- a/tests/unit/create-plugin.test.js +++ b/tests/unit/create-plugin.test.js @@ -34,6 +34,9 @@ test('createPlugin edge cases', async (t) => { } }, getActiveSegment: sinon.stub().returns({}), + tracer: { + getTransaction: sinon.stub().returns({ nameState: { setName: sinon.stub() } }) + }, createSegment: sinon.stub().callsFake((name) => { ctx.nr.operationSegment.name = name return ctx.nr.operationSegment diff --git a/tests/unit/error-helper.test.js b/tests/unit/error-helper.test.js index ac652b0..fd47f73 100644 --- a/tests/unit/error-helper.test.js +++ b/tests/unit/error-helper.test.js @@ -30,6 +30,9 @@ class MockedInstrumentationApi { } this.getActiveSegment = () => {} + this.tracer = { + getTransaction: () => {} + } } } From 2e7827d05cdf7ecdd5bd6ed057739acbd5c86a59 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Tue, 29 Oct 2024 18:00:03 -0400 Subject: [PATCH 2/5] feat: Fixed code after flatenning segment tree --- .../config-capture-scalars.test.js | 2 +- tests/lib/custom-assertions.js | 79 +- tests/lib/find-segment.js | 21 + tests/unit/create-plugin.test.js | 4 +- .../federated-gateway-server-setup.js | 1 - .../query-obfuscation.test.js | 19 +- .../apollo-federation/segments.test.js | 4 +- tests/versioned/apollo-server-express/data | 792 ++++++++++++++++++ tests/versioned/attributes-tests.js | 119 ++- tests/versioned/express-segments-tests.js | 34 +- tests/versioned/query-obfuscation-tests.js | 48 +- 11 files changed, 1014 insertions(+), 109 deletions(-) create mode 100644 tests/lib/find-segment.js create mode 100644 tests/versioned/apollo-server-express/data diff --git a/tests/integration/config-capture-scalars.test.js b/tests/integration/config-capture-scalars.test.js index 73c618a..996f987 100644 --- a/tests/integration/config-capture-scalars.test.js +++ b/tests/integration/config-capture-scalars.test.js @@ -113,7 +113,7 @@ tests.push({ } // Exact match to ensure no extra fields snuck in - assertSegments(transaction.trace.root, expectedSegments, { exact: true }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: true }) }) executeQuery(serverUrl, query, (err) => { diff --git a/tests/lib/custom-assertions.js b/tests/lib/custom-assertions.js index 0b34bee..bfafa0c 100644 --- a/tests/lib/custom-assertions.js +++ b/tests/lib/custom-assertions.js @@ -63,6 +63,64 @@ function assertMetrics( } /** + * This function is used to verify that a tree of trace segments matches an + * expected tree of segment names. For example, if the trace looks like (i.e + * the `parent` parameter): + * + * ```js + * { + * name: 'root-segment', + * children: [ + * { + * name: 'child 1', + * children: [ + * { + * name: 'grandchild 1', + * children: [ + * { + * name: 'great-grandchild', + * children: [] + * } + * ] + * }, + * { + * name: 'grandchild 2', + * children: [] + * } + * ] + * }, + * { + * name: 'child 2', + * children: [] + * } + * ] + * } + * ``` + * + * Then the provided `expected` parameter should look like: + * + * ```js + * [ + * 'root-segment', + * [ + * 'child 1', + * [ + * 'grandchild 1', + * ['great-grandchild], + * 'grandchild 2' + * ], + * 'child 2' + * ], + * ] + * ``` + * + * Ordering of the elements in the `expected` parameter is significant when + * `options.exact = true`. Regardless of the `exact` value, ordering of elements + * is significant to indicate the nesting order. Any string immediately + * followed by an array of strings indicates that the first string is a parent + * element, and the subsequent array of strings is its child elements. + * + * @param {Trace} trace Transaction trace * @param {TraceSegment} parent Parent segment * @param {Array} expected Array of strings that represent segment names. * If an item in the array is another array, it @@ -78,7 +136,13 @@ function assertMetrics( * @param {object} [deps] Injected dependencies. * @param {object} [deps.assert] Assertion library to use. */ -function assertSegments(parent, expected, options, { assert = require('node:assert') } = {}) { +function assertSegments( + trace, + parent, + expected, + options, + { assert = require('node:assert') } = {} +) { let child let childCount = 0 @@ -91,7 +155,8 @@ function assertSegments(parent, expected, options, { assert = require('node:asse } function getChildren(_parent) { - return _parent.children.filter(function (item) { + const children = trace.getChildren(_parent.id) + return children.filter(function (item) { if (exact && options && options.exclude) { return options.exclude.indexOf(item.name) === -1 } @@ -126,7 +191,7 @@ function assertSegments(parent, expected, options, { assert = require('node:asse ) } } else if (typeof sequenceItem === 'object') { - assertSegments(child, sequenceItem, options, { assert }) + assertSegments(trace, child, sequenceItem, options, { assert }) } } @@ -138,14 +203,14 @@ function assertSegments(parent, expected, options, { assert = require('node:asse if (typeof sequenceItem === 'string') { // find corresponding child in parent - for (let j = 0; j < parent.children.length; j++) { - if (parent.children[j].name.startsWith(sequenceItem) === true) { - child = parent.children[j] + for (let j = 0; j < children.length; j++) { + if (children[j].name.startsWith(sequenceItem) === true) { + child = children[j] } } assert.ok(child, 'segment "' + parent.name + '" should have child "' + sequenceItem + '"') if (typeof expected[i + 1] === 'object') { - assertSegments(child, expected[i + 1], { exact }, { assert }) + assertSegments(trace, child, expected[i + 1], { exact }, { assert }) } } } diff --git a/tests/lib/find-segment.js b/tests/lib/find-segment.js new file mode 100644 index 0000000..e831440 --- /dev/null +++ b/tests/lib/find-segment.js @@ -0,0 +1,21 @@ +/* + * Copyright 2025 New Relic Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + */ + +'use strict' +module.exports = function findSegmentByName(trace, root, name) { + const children = trace.getChildren(root.id) + if (root.name === name) { + return root + } else if (children.length) { + for (let i = 0; i < children.length; i++) { + const child = children[i] + const found = findSegmentByName(trace, child, name) + if (found) { + return found + } + } + } + return null +} diff --git a/tests/unit/create-plugin.test.js b/tests/unit/create-plugin.test.js index d2a4bf2..0996100 100644 --- a/tests/unit/create-plugin.test.js +++ b/tests/unit/create-plugin.test.js @@ -17,8 +17,8 @@ test('createPlugin edge cases', async (t) => { ctx.nr.operationSegment = { start: sinon.stub(), addAttribute: sinon.stub(), - transaction: { nameState: { setName: sinon.stub() } }, - end: sinon.stub() + end: sinon.stub(), + start: sinon.stub() } ctx.nr.instrumentationApi = { diff --git a/tests/versioned/apollo-federation/federated-gateway-server-setup.js b/tests/versioned/apollo-federation/federated-gateway-server-setup.js index 21e9a7a..772f905 100644 --- a/tests/versioned/apollo-federation/federated-gateway-server-setup.js +++ b/tests/versioned/apollo-federation/federated-gateway-server-setup.js @@ -5,7 +5,6 @@ 'use strict' const utils = require('@newrelic/test-utilities') - const federatedData = require('./federated-data-definitions') const { unloadModules } = require('../../lib/test-tools') diff --git a/tests/versioned/apollo-federation/query-obfuscation.test.js b/tests/versioned/apollo-federation/query-obfuscation.test.js index 1bdd8ba..3744240 100644 --- a/tests/versioned/apollo-federation/query-obfuscation.test.js +++ b/tests/versioned/apollo-federation/query-obfuscation.test.js @@ -9,6 +9,7 @@ const assert = require('node:assert') const { setupFederatedGateway, teardownGateway } = require('./federated-gateway-server-setup') const { executeQuery } = require('../../lib/test-client') const { checkResult } = require('../common') +const findSegmentByName = require('../../lib/find-segment') const SEGMENT_DESTINATION = 0x20 const ANON_PLACEHOLDER = '' const QUERY_ATTRIBUTE_NAME = 'graphql.operation.query' @@ -45,7 +46,7 @@ test('apollo-federation: query obfuscation', async (t) => { executeQuery(serverUrl, query, (err, result) => { assert.ok(!err) const operationName = `${OPERATION_PREFIX}/${ANON_PLACEHOLDER}/${path}` - const operationSegment = findSegmentByName(tx.trace.root, operationName) + const operationSegment = findSegmentByName(tx.trace, tx.trace.root, operationName) // only test one operation segment of three federated server transactions if (operationSegment) { @@ -59,19 +60,3 @@ test('apollo-federation: query obfuscation', async (t) => { }) }) }) - -function findSegmentByName(root, name) { - if (root.name === name) { - return root - } else if (root.children && root.children.length) { - for (let i = 0; i < root.children.length; i++) { - const child = root.children[i] - const found = findSegmentByName(child, name) - if (found) { - return found - } - } - } - - return null -} diff --git a/tests/versioned/apollo-federation/segments.test.js b/tests/versioned/apollo-federation/segments.test.js index 83b20e3..91f7c88 100644 --- a/tests/versioned/apollo-federation/segments.test.js +++ b/tests/versioned/apollo-federation/segments.test.js @@ -72,7 +72,7 @@ test('apollo-federation: federated segments', async (t) => { ] ] - assertSegments(tx.trace.root, expectedSegments, { exact: false }, { assert: plan }) + assertSegments(tx.trace, tx.trace.root, expectedSegments, { exact: false }, { assert: plan }) checkResult(plan, result, () => {}) }) await plan.completed @@ -141,7 +141,7 @@ test('apollo-federation: federated segments', async (t) => { ] ] - assertSegments(tx.trace.root, expectedSegments, { exact: false }, { assert: plan }) + assertSegments(tx.trace, tx.trace.root, expectedSegments, { exact: false }, { assert: plan }) checkResult(plan, result, () => { plan.equal(result.length, 2) }) diff --git a/tests/versioned/apollo-server-express/data b/tests/versioned/apollo-server-express/data new file mode 100644 index 0000000..81ce047 --- /dev/null +++ b/tests/versioned/apollo-server-express/data @@ -0,0 +1,792 @@ +TAP version 13 +# Subtest: non-scalar: anonymous query, single level +not ok 1 - non-scalar: anonymous query, single level + --- + duration_ms: 238.989792 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:65:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query, single level +not ok 2 - non-scalar: named query, single level + --- + duration_ms: 19.743333 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:103:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: anonymous query, multi-level +not ok 3 - non-scalar: anonymous query, multi-level + --- + duration_ms: 18.592583 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:159:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query, multi-level should return deepest unique path +not ok 4 - non-scalar: named query, multi-level should return deepest unique path + --- + duration_ms: 14.167334 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:216:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query with aliases should use alias in segment naming +not ok 5 - non-scalar: named query with aliases should use alias in segment naming + --- + duration_ms: 16.263042 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:271:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: anonymous mutation, single level +not ok 6 - non-scalar: anonymous mutation, single level + --- + duration_ms: 13.999209 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:312:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named mutation, single level, should use mutation name +not ok 7 - non-scalar: named mutation, single level, should use mutation name + --- + duration_ms: 14.846459 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:354:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: anonymous query, with params +not ok 8 - non-scalar: anonymous query, with params + --- + duration_ms: 12.270875 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:392:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query, with params +not ok 9 - non-scalar: named query, with params + --- + duration_ms: 17.763542 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:431:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query, with params, multi-level +not ok 10 - non-scalar: named query, with params, multi-level + --- + duration_ms: 13.886208 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:488:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query with fragment, query first +not ok 11 - non-scalar: named query with fragment, query first + --- + duration_ms: 14.226375 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:548:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: named query with fragment, fragment first +not ok 12 - non-scalar: named query with fragment, fragment first + --- + duration_ms: 10.669958 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:606:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: batch query should include segments for nested queries +not ok 13 - non-scalar: batch query should include segments for nested queries + --- + duration_ms: 13.714875 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:682:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: union, single level +not ok 14 - non-scalar: union, single level + --- + duration_ms: 10.129709 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:729:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: union, multiple inline fragments, single level +not ok 15 - non-scalar: union, multiple inline fragments, single level + --- + duration_ms: 11.22775 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:777:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: when the query cannot be parsed, should have operation placeholder +not ok 16 - non-scalar: when the query cannot be parsed, should have operation placeholder + --- + duration_ms: 10.694375 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:822:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: non-scalar: when cannot validate, should include operation segment +not ok 17 - non-scalar: when cannot validate, should include operation segment + --- + duration_ms: 11.655542 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:876:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: anonymous query, single level +not ok 18 - scalar: anonymous query, single level + --- + duration_ms: 9.595125 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:65:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query, single level +not ok 19 - scalar: named query, single level + --- + duration_ms: 10.90425 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:103:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: anonymous query, multi-level +not ok 20 - scalar: anonymous query, multi-level + --- + duration_ms: 11.329875 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:159:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query, multi-level should return deepest unique path +not ok 21 - scalar: named query, multi-level should return deepest unique path + --- + duration_ms: 11.507208 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:216:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query with aliases should use alias in segment naming +not ok 22 - scalar: named query with aliases should use alias in segment naming + --- + duration_ms: 10.198833 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:271:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: anonymous mutation, single level +not ok 23 - scalar: anonymous mutation, single level + --- + duration_ms: 12.273375 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:312:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named mutation, single level, should use mutation name +not ok 24 - scalar: named mutation, single level, should use mutation name + --- + duration_ms: 11.036583 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:354:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: anonymous query, with params +not ok 25 - scalar: anonymous query, with params + --- + duration_ms: 10.120208 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:392:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query, with params +not ok 26 - scalar: named query, with params + --- + duration_ms: 9.273166 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:431:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query, with params, multi-level +not ok 27 - scalar: named query, with params, multi-level + --- + duration_ms: 11.0235 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:488:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query with fragment, query first +not ok 28 - scalar: named query with fragment, query first + --- + duration_ms: 11.848208 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:548:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: named query with fragment, fragment first +not ok 29 - scalar: named query with fragment, fragment first + --- + duration_ms: 11.946834 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:606:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: batch query should include segments for nested queries +not ok 30 - scalar: batch query should include segments for nested queries + --- + duration_ms: 12.2155 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:682:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: union, single level +not ok 31 - scalar: union, single level + --- + duration_ms: 10.594333 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:729:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: union, multiple inline fragments, single level +not ok 32 - scalar: union, multiple inline fragments, single level + --- + duration_ms: 9.667 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:777:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: when the query cannot be parsed, should have operation placeholder +not ok 33 - scalar: when the query cannot be parsed, should have operation placeholder + --- + duration_ms: 10.714417 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:822:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +# Subtest: scalar: when cannot validate, should include operation segment +not ok 34 - scalar: when cannot validate, should include operation segment + --- + duration_ms: 9.63075 + location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' + failureType: 'uncaughtException' + error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' + code: 'ERR_ASSERTION' + name: 'AssertionError' + expected: true + operator: '==' + stack: |- + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) + Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:876:7) + Object.onceWrapper (node:events:634:26) + Agent.emit (node:events:531:35) + Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) + ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) + Object.onceWrapper (node:events:633:28) + ServerResponse.emit (node:events:531:35) + ... +1..34 +# tests 34 +# suites 0 +# pass 0 +# fail 34 +# cancelled 0 +# skipped 0 +# todo 0 +# duration_ms 652.1945 diff --git a/tests/versioned/attributes-tests.js b/tests/versioned/attributes-tests.js index 3811350..a10a393 100644 --- a/tests/versioned/attributes-tests.js +++ b/tests/versioned/attributes-tests.js @@ -10,6 +10,7 @@ const assert = require('node:assert') const { executeQuery, executeJson } = require('../lib/test-client') const { match } = require('../lib/custom-assertions') const promiseResolvers = require('../lib/promise-resolvers') +const findSegmentByName = require('../lib/find-segment') const SEGMENT_DESTINATION = 0x20 const SPAN_DESTINATION = 0x10 @@ -21,22 +22,6 @@ function assertCustomAttributes(segment, expected) { match(customResolveAttributes, expected) } -function findSegmentByName(root, name) { - if (root.name === name) { - return root - } else if (root.children && root.children.length) { - for (let i = 0; i < root.children.length; i++) { - const child = root.children[i] - const found = findSegmentByName(child, name) - if (found) { - return found - } - } - } - - return null -} - const tests = [] tests.push({ @@ -51,7 +36,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${ANON_PLACEHOLDER}/hello` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) assertCustomAttributes(operationSegment, { clientName: 'ApolloTestClient' }) @@ -65,7 +54,7 @@ tests.push({ const hasAttribute = Object.hasOwnProperty.bind(operationAttributes) assert.equal(hasAttribute('graphql.operation.name'), false) - const resolveHelloSegment = operationSegment.children[0] + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedResolveAttributes = { 'graphql.field.name': 'hello', @@ -102,7 +91,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/hello` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const expectedOperationAttributes = { 'graphql.operation.type': 'query', @@ -112,7 +105,7 @@ tests.push({ const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) match(operationAttributes, expectedOperationAttributes) - const resolveHelloSegment = operationSegment.children[0] + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedResolveAttributes = { 'graphql.field.name': 'hello', @@ -156,7 +149,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/${deepestPath}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const expectedOperationAttributes = { 'graphql.operation.type': 'query', @@ -166,7 +163,9 @@ tests.push({ const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) match(operationAttributes, expectedOperationAttributes) - const [resolveLibrariesSegment, resolveBooksSegment] = operationSegment.children + const [resolveLibrariesSegment, resolveBooksSegment] = transaction.trace.getChildren( + operationSegment.id + ) const expectedLibrariesAttributes = { 'graphql.field.name': 'libraries', @@ -213,7 +212,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/mutation/${expectedName}/addThing` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const expectedOperationAttributes = { 'graphql.operation.type': 'mutation', @@ -223,7 +226,7 @@ tests.push({ const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) match(operationAttributes, expectedOperationAttributes) - const resolveHelloSegment = operationSegment.children[0] + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedResolveAttributes = { 'graphql.field.name': 'addThing', @@ -259,8 +262,12 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/mutation/${expectedName}/addThing` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) - const resolveHelloSegment = operationSegment.children[0] + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const resolveAttributes = resolveHelloSegment.attributes.get(SEGMENT_DESTINATION) @@ -294,8 +301,12 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/mutation/${expectedName}/addThing` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) - const resolveHelloSegment = operationSegment.children[0] + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const resolveAttributes = resolveHelloSegment.attributes.get(SEGMENT_DESTINATION) const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) @@ -329,8 +340,12 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/paramQuery` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) - const resolveHelloSegment = operationSegment.children[0] + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedArgAttributes = { 'graphql.field.args.blah': 'first', @@ -371,8 +386,12 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/searchByBook` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) - const resolveHelloSegment = operationSegment.children[0] + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedArgAttributes = { 'graphql.field.args.book.author.name': '10x Developer', @@ -419,8 +438,12 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/paramQuery` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) - const resolveHelloSegment = operationSegment.children[0] + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedArgAttributes = { 'graphql.field.args.blah': 'first', @@ -455,7 +478,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/ciao` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const expectedOperationAttributes = { 'graphql.operation.query': query @@ -495,7 +522,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/${deepestPath}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const expectedOperationAttributes = { 'graphql.operation.type': 'query', 'graphql.operation.name': expectedName, @@ -505,7 +536,7 @@ tests.push({ const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) match(operationAttributes, expectedOperationAttributes) - const resolveHelloSegment = operationSegment.children[0] + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedResolveAttributes = { 'graphql.field.name': 'search', @@ -550,7 +581,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/${deepestPath}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const expectedOperationAttributes = { 'graphql.operation.type': 'query', 'graphql.operation.name': expectedName, @@ -560,7 +595,7 @@ tests.push({ const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) match(operationAttributes, expectedOperationAttributes) - const resolveHelloSegment = operationSegment.children[0] + const [resolveHelloSegment] = transaction.trace.getChildren(operationSegment.id) const expectedResolveAttributes = { 'graphql.field.name': 'search', @@ -598,7 +633,11 @@ tests.push({ const transactionHandler = (transaction) => { const operationName = `${OPERATION_PREFIX}/query/${expectedName}/hello` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) if (!operationSegment) { const err = new Error(`Cannot find operation segment with name ${operationName}`) reject(err) diff --git a/tests/versioned/express-segments-tests.js b/tests/versioned/express-segments-tests.js index a5eb82f..7d3d8dc 100644 --- a/tests/versioned/express-segments-tests.js +++ b/tests/versioned/express-segments-tests.js @@ -62,7 +62,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -100,7 +100,7 @@ tests.push({ [`${OPERATION_PREFIX}/${operationPart}`, [`${RESOLVE_PREFIX}/hello`]] ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -156,7 +156,7 @@ tests.push({ const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -213,7 +213,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -268,7 +268,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -309,7 +309,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -351,7 +351,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -389,7 +389,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -428,7 +428,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -485,7 +485,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -545,7 +545,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err) => { @@ -603,7 +603,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err) => { @@ -679,7 +679,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQueryBatch(serverUrl, queries, (err, result) => { @@ -726,7 +726,7 @@ tests.push({ [`${OPERATION_PREFIX}/${operationPart}`, [`${RESOLVE_PREFIX}/search`]] ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -774,7 +774,7 @@ tests.push({ [`${OPERATION_PREFIX}/${operationPart}`, [`${RESOLVE_PREFIX}/search`]] ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, query, (err, result) => { @@ -819,7 +819,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, invalidQuery, (err, result) => { @@ -873,7 +873,7 @@ tests.push({ ] const expectedSegments = constructSegments(firstSegmentName, operationSegments, isApollo4) - assertSegments(transaction.trace.root, expectedSegments, { exact: false }) + assertSegments(transaction.trace, transaction.trace.root, expectedSegments, { exact: false }) }) executeQuery(serverUrl, invalidQuery, (err, result) => { diff --git a/tests/versioned/query-obfuscation-tests.js b/tests/versioned/query-obfuscation-tests.js index 8c98a31..4bfeb69 100644 --- a/tests/versioned/query-obfuscation-tests.js +++ b/tests/versioned/query-obfuscation-tests.js @@ -10,29 +10,13 @@ const assert = require('node:assert') const { executeQuery, executeJson } = require('../lib/test-client') const { checkResult } = require('./common') const promiseReolvers = require('../lib/promise-resolvers') - +const findSegmentByName = require('../lib/find-segment') const SEGMENT_DESTINATION = 0x20 const ANON_PLACEHOLDER = '' const QUERY_ATTRIBUTE_NAME = 'graphql.operation.query' const OPERATION_PREFIX = 'GraphQL/operation/ApolloServer/query' const UNKNOWN_OPERATION_NAME = 'GraphQL/operation/ApolloServer/' -function findSegmentByName(root, name) { - if (root.name === name) { - return root - } else if (root.children && root.children.length) { - for (let i = 0; i < root.children.length; i++) { - const child = root.children[i] - const found = findSegmentByName(child, name) - if (found) { - return found - } - } - } - - return null -} - const tests = [] tests.push({ @@ -56,7 +40,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/${ANON_PLACEHOLDER}/${path}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) @@ -93,7 +81,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/${ANON_PLACEHOLDER}/${path}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) @@ -137,7 +129,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/${expectedName}/${path}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) @@ -176,7 +172,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = `${OPERATION_PREFIX}/${ANON_PLACEHOLDER}/${path}` - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) @@ -213,7 +213,11 @@ tests.push({ helper.agent.once('transactionFinished', (transaction) => { const operationName = UNKNOWN_OPERATION_NAME - const operationSegment = findSegmentByName(transaction.trace.root, operationName) + const operationSegment = findSegmentByName( + transaction.trace, + transaction.trace.root, + operationName + ) const operationAttributes = operationSegment.attributes.get(SEGMENT_DESTINATION) From 96c96ac0b2be283cb8a99ef940606b59d8c67191 Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Tue, 14 Jan 2025 15:09:48 -0500 Subject: [PATCH 3/5] chore: bumped agent in peerDeps and devDeps to work with new structure --- THIRD_PARTY_NOTICES.md | 12 ++++----- package.json | 4 +-- third_party_manifest.json | 52 +++++++++++++++++++-------------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index c53df1c..be96c24 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -47,7 +47,7 @@ code, the source code can be found at [https://github.com/newrelic/newrelic-node ### @apollo/server -This product includes source derived from [@apollo/server](https://github.com/apollographql/apollo-server) ([v4.10.3](https://github.com/apollographql/apollo-server/tree/v4.10.3)), distributed under the [MIT License](https://github.com/apollographql/apollo-server/blob/v4.10.3/README.md): +This product includes source derived from [@apollo/server](https://github.com/apollographql/apollo-server) ([v4.11.2](https://github.com/apollographql/apollo-server/tree/v4.11.2)), distributed under the [MIT License](https://github.com/apollographql/apollo-server/blob/v4.11.2/README.md): ``` MIT License @@ -509,7 +509,7 @@ This product includes source derived from [@newrelic/newrelic-oss-cli](https://g ### @newrelic/test-utilities -This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v8.5.0](https://github.com/newrelic/node-test-utilities/tree/v8.5.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v8.5.0/LICENSE): +This product includes source derived from [@newrelic/test-utilities](https://github.com/newrelic/node-test-utilities) ([v8.7.0](https://github.com/newrelic/node-test-utilities/tree/v8.7.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-test-utilities/blob/v8.7.0/LICENSE): ``` Apache License @@ -905,7 +905,7 @@ OTHER DEALINGS IN THE SOFTWARE. ### eslint -This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v8.57.0](https://github.com/eslint/eslint/tree/v8.57.0)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v8.57.0/LICENSE): +This product includes source derived from [eslint](https://github.com/eslint/eslint) ([v8.57.1](https://github.com/eslint/eslint/tree/v8.57.1)), distributed under the [MIT License](https://github.com/eslint/eslint/blob/v8.57.1/LICENSE): ``` Copyright OpenJS Foundation and other contributors, @@ -932,7 +932,7 @@ THE SOFTWARE. ### graphql -This product includes source derived from [graphql](https://github.com/graphql/graphql-js) ([v16.8.1](https://github.com/graphql/graphql-js/tree/v16.8.1)), distributed under the [MIT License](https://github.com/graphql/graphql-js/blob/v16.8.1/LICENSE): +This product includes source derived from [graphql](https://github.com/graphql/graphql-js) ([v16.9.0](https://github.com/graphql/graphql-js/tree/v16.9.0)), distributed under the [MIT License](https://github.com/graphql/graphql-js/blob/v16.9.0/LICENSE): ``` MIT License @@ -1019,7 +1019,7 @@ SOFTWARE. ### lockfile-lint -This product includes source derived from [lockfile-lint](https://github.com/lirantal/lockfile-lint) ([v4.13.2](https://github.com/lirantal/lockfile-lint/tree/v4.13.2)), distributed under the [Apache-2.0 License](https://github.com/lirantal/lockfile-lint/blob/v4.13.2/LICENSE): +This product includes source derived from [lockfile-lint](https://github.com/lirantal/lockfile-lint) ([v4.14.0](https://github.com/lirantal/lockfile-lint/tree/v4.14.0)), distributed under the [Apache-2.0 License](https://github.com/lirantal/lockfile-lint/blob/v4.14.0/LICENSE): ``` @@ -1217,7 +1217,7 @@ This product includes source derived from [lockfile-lint](https://github.com/lir ### newrelic -This product includes source derived from [newrelic](https://github.com/newrelic/node-newrelic) ([v11.15.0](https://github.com/newrelic/node-newrelic/tree/v11.15.0)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic/blob/v11.15.0/LICENSE): +This product includes source derived from [newrelic](https://github.com/newrelic/node-newrelic) ([v11.23.2](https://github.com/newrelic/node-newrelic/tree/v11.23.2)), distributed under the [Apache-2.0 License](https://github.com/newrelic/node-newrelic/blob/v11.23.2/LICENSE): ``` Apache License diff --git a/package.json b/package.json index f22a57a..9c39bb9 100644 --- a/package.json +++ b/package.json @@ -55,13 +55,13 @@ "husky": "^6.0.0", "lint-staged": "^11.0.0", "lockfile-lint": "^4.9.6", - "newrelic": "^11.15.0", + "newrelic": "^12.11.0", "prettier": "^2.3.2", "sinon": "^11.1.2", "tsd": "^0.18.0" }, "peerDependencies": { - "newrelic": ">=6.13.0" + "newrelic": ">=12.11.0" }, "tsd": { "directory": "./tests/types", diff --git a/third_party_manifest.json b/third_party_manifest.json index 54008aa..4415f86 100644 --- a/third_party_manifest.json +++ b/third_party_manifest.json @@ -1,5 +1,5 @@ { - "lastUpdated": "Fri Dec 06 2024 07:57:39 GMT-0500 (Eastern Standard Time)", + "lastUpdated": "Tue Jan 14 2025 15:09:50 GMT-0500 (Eastern Standard Time)", "projectName": "New Relic Node Apollo Server Plugin", "projectUrl": "https://github.com/newrelic/newrelic-node-apollo-server-plugin/", "includeOptDeps": false, @@ -7,15 +7,15 @@ "includeDev": true, "dependencies": {}, "devDependencies": { - "@apollo/server@4.10.3": { + "@apollo/server@4.11.2": { "name": "@apollo/server", - "version": "4.10.3", + "version": "4.11.2", "range": "^4.1.1", "licenses": "MIT", "repoUrl": "https://github.com/apollographql/apollo-server", - "versionedRepoUrl": "https://github.com/apollographql/apollo-server/tree/v4.10.3", + "versionedRepoUrl": "https://github.com/apollographql/apollo-server/tree/v4.11.2", "licenseFile": "node_modules/@apollo/server/README.md", - "licenseUrl": "https://github.com/apollographql/apollo-server/blob/v4.10.3/README.md", + "licenseUrl": "https://github.com/apollographql/apollo-server/blob/v4.11.2/README.md", "licenseTextSource": "spdx", "publisher": "Apollo", "email": "packages@apollographql.com" @@ -58,15 +58,15 @@ "licenseTextSource": "file", "publisher": "New Relic" }, - "@newrelic/test-utilities@8.5.0": { + "@newrelic/test-utilities@8.7.0": { "name": "@newrelic/test-utilities", - "version": "8.5.0", + "version": "8.7.0", "range": "^8.5.0", "licenses": "Apache-2.0", "repoUrl": "https://github.com/newrelic/node-test-utilities", - "versionedRepoUrl": "https://github.com/newrelic/node-test-utilities/tree/v8.5.0", + "versionedRepoUrl": "https://github.com/newrelic/node-test-utilities/tree/v8.7.0", "licenseFile": "node_modules/@newrelic/test-utilities/LICENSE", - "licenseUrl": "https://github.com/newrelic/node-test-utilities/blob/v8.5.0/LICENSE", + "licenseUrl": "https://github.com/newrelic/node-test-utilities/blob/v8.7.0/LICENSE", "licenseTextSource": "file", "publisher": "New Relic Node.js agent team", "email": "nodejs@newrelic.com" @@ -158,28 +158,28 @@ "licenseTextSource": "file", "publisher": "Teddy Katz" }, - "eslint@8.57.0": { + "eslint@8.57.1": { "name": "eslint", - "version": "8.57.0", + "version": "8.57.1", "range": "^8.24.0", "licenses": "MIT", "repoUrl": "https://github.com/eslint/eslint", - "versionedRepoUrl": "https://github.com/eslint/eslint/tree/v8.57.0", + "versionedRepoUrl": "https://github.com/eslint/eslint/tree/v8.57.1", "licenseFile": "node_modules/eslint/LICENSE", - "licenseUrl": "https://github.com/eslint/eslint/blob/v8.57.0/LICENSE", + "licenseUrl": "https://github.com/eslint/eslint/blob/v8.57.1/LICENSE", "licenseTextSource": "file", "publisher": "Nicholas C. Zakas", "email": "nicholas+npm@nczconsulting.com" }, - "graphql@16.8.1": { + "graphql@16.9.0": { "name": "graphql", - "version": "16.8.1", + "version": "16.9.0", "range": "^16.6.0", "licenses": "MIT", "repoUrl": "https://github.com/graphql/graphql-js", - "versionedRepoUrl": "https://github.com/graphql/graphql-js/tree/v16.8.1", + "versionedRepoUrl": "https://github.com/graphql/graphql-js/tree/v16.9.0", "licenseFile": "node_modules/graphql/LICENSE", - "licenseUrl": "https://github.com/graphql/graphql-js/blob/v16.8.1/LICENSE", + "licenseUrl": "https://github.com/graphql/graphql-js/blob/v16.9.0/LICENSE", "licenseTextSource": "file" }, "husky@6.0.0": { @@ -208,29 +208,29 @@ "publisher": "Andrey Okonetchnikov", "email": "andrey@okonet.ru" }, - "lockfile-lint@4.13.2": { + "lockfile-lint@4.14.0": { "name": "lockfile-lint", - "version": "4.13.2", + "version": "4.14.0", "range": "^4.9.6", "licenses": "Apache-2.0", "repoUrl": "https://github.com/lirantal/lockfile-lint", - "versionedRepoUrl": "https://github.com/lirantal/lockfile-lint/tree/v4.13.2", + "versionedRepoUrl": "https://github.com/lirantal/lockfile-lint/tree/v4.14.0", "licenseFile": "node_modules/lockfile-lint/LICENSE", - "licenseUrl": "https://github.com/lirantal/lockfile-lint/blob/v4.13.2/LICENSE", + "licenseUrl": "https://github.com/lirantal/lockfile-lint/blob/v4.14.0/LICENSE", "licenseTextSource": "file", "publisher": "Liran Tal", "email": "liran.tal@gmail.com", "url": "https://github.com/lirantal" }, - "newrelic@11.15.0": { + "newrelic@11.23.2": { "name": "newrelic", - "version": "11.15.0", - "range": "^11.15.0", + "version": "11.23.2", + "range": "^12.11.0", "licenses": "Apache-2.0", "repoUrl": "https://github.com/newrelic/node-newrelic", - "versionedRepoUrl": "https://github.com/newrelic/node-newrelic/tree/v11.15.0", + "versionedRepoUrl": "https://github.com/newrelic/node-newrelic/tree/v11.23.2", "licenseFile": "node_modules/newrelic/LICENSE", - "licenseUrl": "https://github.com/newrelic/node-newrelic/blob/v11.15.0/LICENSE", + "licenseUrl": "https://github.com/newrelic/node-newrelic/blob/v11.23.2/LICENSE", "licenseTextSource": "file", "publisher": "New Relic Node.js agent team", "email": "nodejs@newrelic.com" From 2f0d52b1f723529d8310536b4e56176161bc692a Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Tue, 14 Jan 2025 15:12:18 -0500 Subject: [PATCH 4/5] chore: Update lib/common.js Co-authored-by: James Sumners --- lib/common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.js b/lib/common.js index 4f68ac3..8353450 100644 --- a/lib/common.js +++ b/lib/common.js @@ -170,7 +170,7 @@ function updateOperationSegmentName(context, operationSegment, transaction) { * * @param {Object} params * @param {Object} params.config plugin config - * @param {Object} paramst.info info key from resolver context + * @param {Object} params.info info key from resolver context * @param {Object} params.transaction active transaction * @param {Object} params.args args key from resolver context * From 93113e4631b21b62f7077c6cffc91190f4f8a8fb Mon Sep 17 00:00:00 2001 From: Bob Evans Date: Tue, 14 Jan 2025 15:35:46 -0500 Subject: [PATCH 5/5] chore: removed a testing file --- tests/versioned/apollo-server-express/data | 792 --------------------- 1 file changed, 792 deletions(-) delete mode 100644 tests/versioned/apollo-server-express/data diff --git a/tests/versioned/apollo-server-express/data b/tests/versioned/apollo-server-express/data deleted file mode 100644 index 81ce047..0000000 --- a/tests/versioned/apollo-server-express/data +++ /dev/null @@ -1,792 +0,0 @@ -TAP version 13 -# Subtest: non-scalar: anonymous query, single level -not ok 1 - non-scalar: anonymous query, single level - --- - duration_ms: 238.989792 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:65:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query, single level -not ok 2 - non-scalar: named query, single level - --- - duration_ms: 19.743333 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:103:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: anonymous query, multi-level -not ok 3 - non-scalar: anonymous query, multi-level - --- - duration_ms: 18.592583 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:159:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query, multi-level should return deepest unique path -not ok 4 - non-scalar: named query, multi-level should return deepest unique path - --- - duration_ms: 14.167334 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:216:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query with aliases should use alias in segment naming -not ok 5 - non-scalar: named query with aliases should use alias in segment naming - --- - duration_ms: 16.263042 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:271:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: anonymous mutation, single level -not ok 6 - non-scalar: anonymous mutation, single level - --- - duration_ms: 13.999209 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:312:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named mutation, single level, should use mutation name -not ok 7 - non-scalar: named mutation, single level, should use mutation name - --- - duration_ms: 14.846459 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:354:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: anonymous query, with params -not ok 8 - non-scalar: anonymous query, with params - --- - duration_ms: 12.270875 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:392:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query, with params -not ok 9 - non-scalar: named query, with params - --- - duration_ms: 17.763542 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:431:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query, with params, multi-level -not ok 10 - non-scalar: named query, with params, multi-level - --- - duration_ms: 13.886208 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:488:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query with fragment, query first -not ok 11 - non-scalar: named query with fragment, query first - --- - duration_ms: 14.226375 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:548:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: named query with fragment, fragment first -not ok 12 - non-scalar: named query with fragment, fragment first - --- - duration_ms: 10.669958 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:606:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: batch query should include segments for nested queries -not ok 13 - non-scalar: batch query should include segments for nested queries - --- - duration_ms: 13.714875 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:682:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: union, single level -not ok 14 - non-scalar: union, single level - --- - duration_ms: 10.129709 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:729:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: union, multiple inline fragments, single level -not ok 15 - non-scalar: union, multiple inline fragments, single level - --- - duration_ms: 11.22775 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:777:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: when the query cannot be parsed, should have operation placeholder -not ok 16 - non-scalar: when the query cannot be parsed, should have operation placeholder - --- - duration_ms: 10.694375 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:822:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: non-scalar: when cannot validate, should include operation segment -not ok 17 - non-scalar: when cannot validate, should include operation segment - --- - duration_ms: 11.655542 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:19:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:876:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: anonymous query, single level -not ok 18 - scalar: anonymous query, single level - --- - duration_ms: 9.595125 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:65:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query, single level -not ok 19 - scalar: named query, single level - --- - duration_ms: 10.90425 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:103:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: anonymous query, multi-level -not ok 20 - scalar: anonymous query, multi-level - --- - duration_ms: 11.329875 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:159:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query, multi-level should return deepest unique path -not ok 21 - scalar: named query, multi-level should return deepest unique path - --- - duration_ms: 11.507208 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:216:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query with aliases should use alias in segment naming -not ok 22 - scalar: named query with aliases should use alias in segment naming - --- - duration_ms: 10.198833 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:271:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: anonymous mutation, single level -not ok 23 - scalar: anonymous mutation, single level - --- - duration_ms: 12.273375 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:312:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named mutation, single level, should use mutation name -not ok 24 - scalar: named mutation, single level, should use mutation name - --- - duration_ms: 11.036583 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:354:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: anonymous query, with params -not ok 25 - scalar: anonymous query, with params - --- - duration_ms: 10.120208 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:392:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query, with params -not ok 26 - scalar: named query, with params - --- - duration_ms: 9.273166 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:431:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query, with params, multi-level -not ok 27 - scalar: named query, with params, multi-level - --- - duration_ms: 11.0235 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:488:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query with fragment, query first -not ok 28 - scalar: named query with fragment, query first - --- - duration_ms: 11.848208 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:548:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: named query with fragment, fragment first -not ok 29 - scalar: named query with fragment, fragment first - --- - duration_ms: 11.946834 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:606:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: batch query should include segments for nested queries -not ok 30 - scalar: batch query should include segments for nested queries - --- - duration_ms: 12.2155 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:682:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: union, single level -not ok 31 - scalar: union, single level - --- - duration_ms: 10.594333 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:729:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: union, multiple inline fragments, single level -not ok 32 - scalar: union, multiple inline fragments, single level - --- - duration_ms: 9.667 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:777:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: when the query cannot be parsed, should have operation placeholder -not ok 33 - scalar: when the query cannot be parsed, should have operation placeholder - --- - duration_ms: 10.714417 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:822:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -# Subtest: scalar: when cannot validate, should include operation segment -not ok 34 - scalar: when cannot validate, should include operation segment - --- - duration_ms: 9.63075 - location: '/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/apollo-server-express/segments.test.js:28:3' - failureType: 'uncaughtException' - error: 'segment "Expressjs/Router: /" should have child "Nodejs/Middleware/Expressjs/"' - code: 'ERR_ASSERTION' - name: 'AssertionError' - expected: true - operator: '==' - stack: |- - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:211:16) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - assertSegments (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/lib/custom-assertions.js:213:11) - Agent. (/Users/revans/code/newrelic-node-apollo-server-plugin/tests/versioned/express-segments-tests.js:876:7) - Object.onceWrapper (node:events:634:26) - Agent.emit (node:events:531:35) - Transaction.end (/Users/revans/code/release/node-newrelic/lib/transaction/index.js:220:14) - ServerResponse.instrumentedFinish (/Users/revans/code/release/node-newrelic/lib/instrumentation/core/http.js:206:15) - Object.onceWrapper (node:events:633:28) - ServerResponse.emit (node:events:531:35) - ... -1..34 -# tests 34 -# suites 0 -# pass 0 -# fail 34 -# cancelled 0 -# skipped 0 -# todo 0 -# duration_ms 652.1945