android / android/android-test
Exceptions in after methods hide exceptions in test methods
- Lingua principale
- Java
- Stelle
- 1.2k
- Fork
- 342
- Merge medio
- 11h 29m
- PR unite (30g)
- 2
Descrizione
### Description
Exceptions from `@After` methods hide exceptions from test methods, which sometimes makes debugging tests difficult. Also this behavior differs from desktop JUnit 4 behavior.
### Steps to Reproduce
1. Setup a test class where both a test method and an after method throw.
2. Run the test class
3. Check the results (Gradle console output, HTML and XML reports, run log in Android Studio)
### Expected Results (based on desktop JUnit behavior)
Exceptions from both the test method and the after method are reported:
- Exceptions from both methods should be reported in Gradle console output
- HTML report should include exceptions from both methods
- XML report should have 2 failure nodes for the test
- Execution log in Android Studio should contain exception messages from both methods
### Actual Results
Only the exception thrown from the after method is reported by Gradle, HTML and XML reports, Android Studio.
### AndroidX Test and Android OS Versions
Tested with API levels 24, 26, 30 and AndroidX Test 1.2.0.
### Link to a public git repo demonstrating the problem:
https://github.com/TarCV/android-junit-issue
Run instrumented tests to demonstrate the issue.
I've also added similar normal unit tests to make it easier comparing AndroidX test results with desktop test results.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia eseguendo i test strumentati dal repository pubblico di riproduzione collegato e confronta i risultati di AndroidX Test con quelli dei normali test unitari. Esamina come vengono rappresentati gli errori nell’output della console Gradle, nei report HTML e XML e nel log di esecuzione di Android Studio. Il lavoro è completato quando sia le eccezioni del metodo di test sia le eccezioni @After compaiono in ciascun risultato richiesto, inclusi due nodi di errore XML.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, java
- Ambito
- mobile, testing
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100