From 8130a439f665c59ee97e0aa13e57e7967dc86e70 Mon Sep 17 00:00:00 2001 From: Mark Peace Date: Thu, 5 Oct 2017 20:28:10 +0100 Subject: [PATCH] Remap query plan arguments to the root object - Run skipped boltMapping tests --- src/shared/services/bolt/boltMappings.js | 18 +++++------------- src/shared/services/bolt/boltMappings.test.js | 4 ++-- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/src/shared/services/bolt/boltMappings.js b/src/shared/services/bolt/boltMappings.js index c3c8b1edb25..e72fe3c1f38 100644 --- a/src/shared/services/bolt/boltMappings.js +++ b/src/shared/services/bolt/boltMappings.js @@ -95,24 +95,16 @@ export function extractPlan (result, calculateTotalDbHits = false) { const boltPlanToRESTPlanShared = plan => { return { operatorType: plan.operatorType, - LegacyExpression: plan.arguments.LegacyExpression, - ExpandExpression: plan.arguments.ExpandExpression, DbHits: plan.dbHits, Rows: plan.rows, - EstimatedRows: plan.arguments.EstimatedRows, identifiers: plan.identifiers, - Index: plan.arguments.Index, - children: plan.children.map(boltPlanToRESTPlanShared) + children: plan.children.map(_ => ({ + ...boltPlanToRESTPlanShared(_), + ..._.arguments + })) } } - let obj = boltPlanToRESTPlanShared(rawPlan) - obj['runtime-impl'] = rawPlan.arguments['runtime-impl'] - obj['planner-impl'] = rawPlan.arguments['planner-impl'] - obj['version'] = rawPlan.arguments['version'] - obj['KeyNames'] = rawPlan.arguments['KeyNames'] - obj['planner'] = rawPlan.arguments['planner'] - obj['runtime'] = rawPlan.arguments['runtime'] - obj['Signature'] = rawPlan.arguments['Signature'] + let obj = { ...boltPlanToRESTPlanShared(rawPlan), ...rawPlan.arguments } if (calculateTotalDbHits === true) { obj.totalDbHits = collectHits(obj) diff --git a/src/shared/services/bolt/boltMappings.test.js b/src/shared/services/bolt/boltMappings.test.js index 9938e7ff987..261eff469bc 100644 --- a/src/shared/services/bolt/boltMappings.test.js +++ b/src/shared/services/bolt/boltMappings.test.js @@ -371,7 +371,7 @@ describe('boltMappings', () => { expect(extractedPlan.Signature).toEqual('Signature') } - test.skip('should extract plan from result summary', () => { + test('should extract plan from result summary', () => { // Given const result = { summary: { @@ -382,7 +382,7 @@ describe('boltMappings', () => { checkExtractedPlan(extractedPlan) }) - test.skip('should extract profile from result summary', () => { + test('should extract profile from result summary', () => { // Given const profile = createPlan() profile.dbHits = 20