Skip to content

Commit

Permalink
additional fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bryce-b committed Sep 6, 2024
1 parent 96ad20e commit 0fe5b64
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand Down
10 changes: 5 additions & 5 deletions x-pack/test/apm_api_integration/tests/traces/trace_by_id.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
});
Expand All @@ -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_🍏']);
Expand Down

0 comments on commit 0fe5b64

Please sign in to comment.