From 0fe5b64c4d0b6e080ed5fa14944242924a7b5b3f Mon Sep 17 00:00:00 2001 From: Bryce Buchanan Date: Fri, 6 Sep 2024 13:17:28 -0700 Subject: [PATCH] additional fixes --- .../tests/traces/find_traces.spec.ts | 4 ++-- .../tests/traces/trace_by_id.spec.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts b/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts index 369490ae06d44..b1f578da2cabc 100644 --- a/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts +++ b/x-pack/test/apm_api_integration/tests/traces/find_traces.spec.ts @@ -184,8 +184,8 @@ export default function ApiTest({ getService }: FtrProviderContext) { const mapped = traces.map((traceDocs) => { return sortBy(traceDocs, '@timestamp') - .filter((doc) => doc.processor.event === 'transaction') - .map((doc) => doc.service.name); + .filter((doc) => doc['processor.event']?.[0] === 'transaction') + .map((doc) => doc['service.name']?.[0]); }); expect(mapped).to.eql([ diff --git a/x-pack/test/apm_api_integration/tests/traces/trace_by_id.spec.ts b/x-pack/test/apm_api_integration/tests/traces/trace_by_id.spec.ts index de07f3664104c..bbb2ae6237cc1 100644 --- a/x-pack/test/apm_api_integration/tests/traces/trace_by_id.spec.ts +++ b/x-pack/test/apm_api_integration/tests/traces/trace_by_id.spec.ts @@ -116,7 +116,7 @@ export default function ApiTest({ getService }: FtrProviderContext) { it('returns some errors', () => { expect(traces.traceItems.errorDocs.length).to.be.greaterThan(0); - expect(traces.traceItems.errorDocs[0].error.exception?.[0].message).to.eql( + expect(traces.traceItems.errorDocs[0]['error.exception.message']?.[0]).to.eql( '[ResponseError] index_not_found_exception' ); }); @@ -125,11 +125,11 @@ export default function ApiTest({ getService }: FtrProviderContext) { expect(traces.traceItems.traceDocs.length).to.be.greaterThan(0); expect( traces.traceItems.traceDocs.map((item) => { - if (item.span && 'name' in item.span) { - return item.span.name; + if (item['span.name']) { + return item['span.name']?.[0]; } - if (item.transaction && 'name' in item.transaction) { - return item.transaction.name; + if (item['transaction.name']?.[0]) { + return item['transaction.name']?.[0]; } }) ).to.eql(['GET /apple 🍏', 'get_green_apple_🍏']);