[Bug]: TestMethodNameDetector does not scan all tests

Abierto Apto para principiantes
#1,984 0 comentarios 0 reacciones 0 asignados Ver en GitHub

@drawers ya está trabajando en esto.

Desde el 6/11/2025.

  • #1985 de @drawers — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
68/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
kotlin
Área
testing

Línea de trabajo

Empieza por TestMethodNameDetector.kt y las anotaciones utilizadas en InterestListsDetailsScreenTest.kt; después ejecuta gradle :app:lintAnalyzeDemoDebugUnitTest. Comprueba cómo se seleccionan los tipos de uso de las anotaciones para el escaneo. La tarea está terminada cuando un método de prueba renombrado con el prefijo test_ produce una advertencia tanto en el IDE como en la Gradle lint task.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Is there an existing issue for this?
  • I have searched the existing issues
Is there a StackOverflow question about this issue?
  • I have searched StackOverflow
What happened?
  1. Go to InterestListsDetailsScreenTest.kt
  2. Change one of the test names to include the prefix test_
Expected

TestMethodNameDetector should issue a warning, both in the IDE and in tasks like gradle :app:lintAnalyzeDemoDebugUnitTest

Actual

No warning

The reason this is happening is because the annotations on the tests in InterestListsDetailsScreenTest.kt have AnnotationUsageType.DEFINITION which the TestMethodNameDetector.kt does not currently opt-in to scan for. Will submit a patch.

Code of Conduct
  • I agree to follow this project's Code of Conduct
Lenguaje dominante
Kotlin
Estrellas
22.1k
Forks
4.7k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

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 android/nowinandroid

Todos los issues de android/nowinandroid

Issues similares

Más issues de Kotlin

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.