From 985248f655e13bcc0795669613519bd656de41f3 Mon Sep 17 00:00:00 2001 From: Ruben Vargas Date: Wed, 8 Apr 2020 18:01:01 -0500 Subject: [PATCH] Add deduplet ddg paths test Signed-off-by: Ruben Vargas --- .../src/model/ddg/transformTracesToPaths.test.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/jaeger-ui/src/model/ddg/transformTracesToPaths.test.js b/packages/jaeger-ui/src/model/ddg/transformTracesToPaths.test.js index 855f257c90..2b3942d8b9 100644 --- a/packages/jaeger-ui/src/model/ddg/transformTracesToPaths.test.js +++ b/packages/jaeger-ui/src/model/ddg/transformTracesToPaths.test.js @@ -170,4 +170,15 @@ describe('transform traces to ddg paths', () => { expect(new Set(result)).toEqual(new Set([path])); }); + + it('dedupled paths', () => { + const otherSpan = makeSpan('other-span', focalSpan); + otherSpan.hasChildren = false; + const trace1 = makeTrace([rootSpan, focalSpan, otherSpan], 'trace1'); + const trace2 = makeTrace([rootSpan, focalSpan, otherSpan], 'trace2'); + const { dependencies: result } = transformTracesToPaths(makeTraces(trace1, trace2), focalSvc); + const path = makeExpectedPath([rootSpan, focalSpan, otherSpan], trace1); + path.attributes.push({ key: 'exemplar_trace_id', value: trace2.data.traceID }); + expect(new Set(result)).toEqual(new Set([path])); + }); });