You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
beforeAll 0
beforeEach 8692252888825984513
test 8692252888825984513
afterEach 8692252888825984513
afterAll 0
I'm curious why active trace is missing in beforeAll and afterAll? I was expecting TestSession and TestModule spans to be already created at this point by CIVisibility auto-instrumentation.
Beside this main question I also noticed that beforeEach and afterEach spans are not visible in DD UI (only the test span).
Context: JUnit5 Lifecycle methods (methods annotated with @BeforeAll, @AfterAll, @BeforeEach, or @AfterEach that are used for setting up and tearing down tests) are significant subjects for tracing because, like test methods, they often involve network requests, database queries, and similar operations.
Thank you for looking into this!
The text was updated successfully, but these errors were encountered:
sergeidyga
changed the title
Trace Lifecycle methods in JUnit5 instrumentation
Feature Request: JUnit5 Instrumentation to Include Lifecycle Methods in Tracing
Apr 23, 2024
sergeidyga
changed the title
Feature Request: JUnit5 Instrumentation to Include Lifecycle Methods in Tracing
Feature Request: Missing trace for JUnit5 BeforeAll/AfterAll methods in CIVisibility Instrumentation
Apr 30, 2024
You're right that TestSession and TestModule spans already exist by the time a method marked with@BeforeAll is executed. Moreover, TestSuite exists as well, so it'd make sense to have spans for these lifecycle methods as children of their respective suite.
The problem is that to have a suite child that is not a test case a few things have to be changed both in the tracer and in the Datadog backend.
We've had this feature in our backlog for a while, unfortunately there are no plans to support it in the near future (although it might change given that there is user demand).
Thank you for confirming that the TestSuite span exists by the time JUnit lifecycle methods start. But although TestSuite span exist I'm not able to get its traceId with CorrelationIdentifier.getTraceId()? So I'm I doubt how to access a suite span in order to build a test span as its child?
Hello team 馃憢
I'm using JUnit5 Instrumentation with following config:
Following class:
Gives following output:
I'm curious why active trace is missing in
beforeAll
andafterAll
? I was expecting TestSession and TestModule spans to be already created at this point by CIVisibility auto-instrumentation.Beside this main question I also noticed that
beforeEach
andafterEach
spans are not visible in DD UI (only the test span).Context: JUnit5 Lifecycle methods (methods annotated with
@BeforeAll
,@AfterAll
,@BeforeEach
, or@AfterEach
that are used for setting up and tearing down tests) are significant subjects for tracing because, like test methods, they often involve network requests, database queries, and similar operations.Thank you for looking into this!
The text was updated successfully, but these errors were encountered: