Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Feature: allow custom tags on JUnit 4 ignored tests (onTestIgnore / fireTestIgnored)

Abierto
#11,438 1 comentario 0 reacciones 1 asignado Ver en GitHub

@daniel-mohedano ya está trabajando en esto.

Desde el 22/5/2026.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

type: feature request
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

Lenguaje dominante
Java
Estrellas
737
Forks
361
Merge medio
3 d 20 h
PR fusionados (30 d)
173

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DataDog/dd-trace-java

Todos los issues de DataDog/dd-trace-java

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.