[FR]: Enhance flow testing methodology using backgroundScope
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 20/100
Direzione di ricerca
Inizia esaminando il pattern esistente di raccolta di flow nel test di ViewModel e confrontalo con la documentazione per sviluppatori Android relativa a backgroundScope. Identifica gli altri test rilevanti di flow che creano e annullano manualmente i jobs, quindi esegui la suite di test per confermare che la metodologia aggiornata funzioni senza annullamento manuale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Is there an existing issue for this?
- I have searched the existing issues
Describe the problem
Currently, our flow testing methodology in the NowInAndroid project requires manually creating and canceling job objects to collect flows during tests. This approach can be error-prone and doesn't align with the latest best practices recommended in the Android developer documentation. (example in viewModel test )
Describe the solution
I propose updating our flow testing methodology to utilize backgroundScope for collecting flows. This solution offers several benefits:
- Eliminates the need to manually create and cancel job objects.
- Provides automatic cancellation of the coroutine before the end of the test.
- Aligns with the latest best practices as documented by Android developers.
Implementation details:
• Replace current job creation and cancellation with backgroundScope.
• Update relevant test cases to use this new methodology.
• Ensure all tests pass with the new implementation.
References:
i have already created a pull request implementing this change: https://github.com/android/nowinandroid/pull/1585
Additional context
This change will simplify our test code, reduce the risk of forgetting to cancel job objects, and improve our alignment with current Android development best practices. It will make our tests more robust and easier to maintain in the long run.
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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di android/nowinandroid
-
[Bug]: Search empty-state copy reads "explorer" instead of "explore"Forse già presa @Amir-yazdanmanesh l’ha presa 168 giorni fa. Apertabug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
android/nowinandroid#2127 ·
-
[Documentation]: Grammar error in SyncInitializer commentForse già presa @sahilpatel2521 l’ha presa 185 giorni fa. Apertadocumentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
android/nowinandroid#2121 ·
-
[FR]: Move TopicScreen user-facing strings to resourcesForse già presa @ois0886 l’ha presa 189 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
android/nowinandroid#2115 ·
-
[Bug]: Interests top-level nav label sources string from feature/search instead of feature/interestsForse già presa @Noahs212 l’ha presa 193 giorni fa. Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
android/nowinandroid#2112 ·
-
[FR]: Add network connectivity check before launching Chrome Custom TabForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
android/nowinandroid#2110 ·
Tutte le issue di android/nowinandroid
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
emm3000/myGame#2175 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
MetrolistGroup/Metrolist#5426 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
backend
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
digitalfabrik/entitlementcard#3330 ·
I maintainer di solito rispondono entro 2 giorni