Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-util</artifactId>
<version>0.33.0</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import io.cucumber.plugin.event.SnippetsSuggestedEvent;
import io.cucumber.plugin.event.Status;
import io.cucumber.plugin.event.TestCaseFinished;
import io.opentracing.util.GlobalTracer;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.function.Supplier;
Expand Down Expand Up @@ -59,6 +61,14 @@ public void assertTestCasePassed(
return;
}
Throwable error = result.getError();

ArrayList<StackTraceElement> staketrace = new ArrayList<StackTraceElement>(
Arrays.asList(error.getStackTrace()));
staketrace.add(
new StackTraceElement("Jaeger", "Precommit",
GlobalTracer.get().activeSpan().context().toTraceId(), 0));
error.setStackTrace(staketrace.toArray(new StackTraceElement[staketrace.size()]));

if (status.is(SKIPPED) && error == null) {
Throwable throwable = testCaseSkipped.get();
throw new TestCaseFailed(throwable);
Expand Down