[Bug]: TestMethodNameDetector does not scan all tests

Aperta Adatta ai principianti
#1,984 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@drawers ci sta già lavorando.

Dal 6/11/2025.

  • #1985 di @drawers — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
kotlin
Ambito
testing

Direzione di ricerca

Inizia da TestMethodNameDetector.kt e dalle annotazioni utilizzate in InterestListsDetailsScreenTest.kt, quindi esegui gradle :app:lintAnalyzeDemoDebugUnitTest. Verifica come vengono selezionati i tipi di utilizzo delle annotazioni per la scansione. Il lavoro è completato quando un metodo di test rinominato con il prefisso test_ produce un avviso sia nell’IDE sia nella Gradle lint task.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
Kotlin
Stelle
22.1k
Fork
4.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di android/nowinandroid

Tutte le issue di android/nowinandroid

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.