Feature: allow custom tags on JUnit 4 ignored tests (onTestIgnore / fireTestIgnored)
@daniel-mohedano đang làm issue này rồi.
Từ ngày 22/5/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Library Name
dd-java-agent
Library Version(s)
1.60.3
Describe the feature you'd like
| Section | Content |
|---|---|
| Problem | Need is_ignored custom tags (and optional skip reason) on agent-reported ignored tests in CI with javaagent + Gradle. |
| Current behavior | onTestIgnore does start → skip → end synchronously; app RunListener.testIgnored runs outside that window, so Span.current() / manual DDTest either don’t tag the agent test or create a second session (suite conflicts). |
| Desired behavior | Hook to set tags on the same test span Datadog creates for @Ignore / fireTestIgnored, e.g. public API, TestEventsHandler callback, or documented extension point. |
| Environment | JUnit 4, dd-java-agent 1.60.3, Kotlin kotlin.test.Ignore + JVM Robolectric, Buildkite. |
Is your feature request related to a problem?
I try to set custom tag on @Ignore test with Datadog Test Optimization with Java Tests on an android project, and notice that there is no active span, as Span.current() is not working for @Ignore test.
Below is the sample code:
class TestIgnoredListener : RunListener() {
override fun testIgnored(description: Description) {
Span.current().setAttribute("is_ignored", true)
}
}
class CustomRobolectricTestRunner(testClass: Class<*>) : RobolectricTestRunner(testClass) {
...
override fun run(notifier: RunNotifier) {
notifier.addListener(TestIgnoredListener())
super.run(notifier)
}
...
}
@RunWith(CustomRobolectricTestRunner::class)
class CreateThreadPickMediaTest {
...
@Test
@Ignore(
"java.lang.SecurityException: " +
"Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider" +
" requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs"
)
fun givenPickMediaIntent_whenPickMedia_thenImagePreviewContentIsShown() {
...
}
...
}
Describe alternatives you've considered
Tried Manual Testing API (CIVisibility + DDTest#setTag) only without javaagent, too much works to write all the RunListener on my own (similar to dd-java-agent JUnit4TracingListener).
Additional context
No response
- Ngôn ngữ chính
- Java
- Star
- 737
- Fork
- 361
- Merge trung bình
- 3 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 173
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của DataDog/dd-trace-java
-
type: feature request
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 70/100
DataDog/dd-trace-java#10245 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 62/100
DataDog/dd-trace-java#12608 ·
-
type: bug report
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
DataDog/dd-trace-java#12597 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
DataDog/dd-trace-java#12540 · 4 bình luận · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
DataDog/dd-trace-java#12480 ·
Tất cả issue của DataDog/dd-trace-java
Issue tương tự
-
executions.Query — startDate and timeRange filters are sent with inverted comparison operators Đang mởarea/plugin
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
kestra-io/plugin-kestra#190 ·
-
litertlm-android AAR ships no consumer ProGuard rules → "mid == null" SIGABRT in minified apps Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
google-ai-edge/LiteRT-LM#3739 ·
-
Add canonical URLs and a sitemap Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
integra-team-red/meet-map#249 ·
-
[Studio][Bug] Cancelled create-user dialog keeps the password and admin switch for the next attempt Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
apache/rocketmq-dashboard#5064 ·
-
Consent portal: creating a duplicate Purpose shows a generic error instead of "already exists" Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
wso2/dpdp-accelerator#287 ·