[FR]: Enhance flow testing methodology using backgroundScope
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 20/100
Línea de trabajo
Comienza revisando el patrón existente de recopilación de flow en la prueba de ViewModel y compáralo con la documentación para desarrolladores de Android sobre backgroundScope. Identifica las otras pruebas relevantes de flow que crean y cancelan jobs manualmente, y luego ejecuta la suite de pruebas para confirmar que la metodología actualizada funciona sin cancelación manual.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- Kotlin
- Estrellas
- 22.1k
- Forks
- 4.7k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de android/nowinandroid
-
[Bug]: Search empty-state copy reads "explorer" instead of "explore"Posiblemente ocupada @Amir-yazdanmanesh la tomó hace 168 días. Abiertobug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
android/nowinandroid#2127 ·
-
[Documentation]: Grammar error in SyncInitializer commentPosiblemente ocupada @sahilpatel2521 la tomó hace 185 días. Abiertodocumentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
android/nowinandroid#2121 ·
-
[FR]: Move TopicScreen user-facing strings to resourcesPosiblemente ocupada @ois0886 la tomó hace 189 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
android/nowinandroid#2115 ·
-
[Bug]: Interests top-level nav label sources string from feature/search instead of feature/interestsPosiblemente ocupada @Noahs212 la tomó hace 193 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
android/nowinandroid#2112 ·
-
[FR]: Add network connectivity check before launching Chrome Custom TabPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
android/nowinandroid#2110 ·
Todos los issues de android/nowinandroid
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
emm3000/myGame#2175 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
MetrolistGroup/Metrolist#5426 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
backend
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
digitalfabrik/entitlementcard#3330 ·
Los mantenedores suelen responder en 2 días