[FR]: Enhance flow testing methodology using backgroundScope
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 20/100
調査の方向性
まず、ViewModel のテストにおける既存の flow 収集パターンを確認し、Android 開発者向けドキュメントの backgroundScope に関する説明と比較します。手動で jobs を作成してキャンセルしている、その他の関連する flow テストを特定し、その後テストスイートを実行して、更新された方法が手動キャンセルなしで通過することを確認します。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Kotlin
- スター
- 22.1k
- フォーク
- 4.7k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
android/nowinandroid のほかの issue
-
[Bug]: Search empty-state copy reads "explorer" instead of "explore"対応中かも @Amir-yazdanmanesh が 168 日前に担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
android/nowinandroid#2127 ·
-
[Documentation]: Grammar error in SyncInitializer comment対応中かも @sahilpatel2521 が 185 日前に担当しました。 オープンdocumentation
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
android/nowinandroid#2121 ·
-
[FR]: Move TopicScreen user-facing strings to resources対応中かも @ois0886 が 189 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
android/nowinandroid#2115 ·
-
[Bug]: Interests top-level nav label sources string from feature/search instead of feature/interests対応中かも @Noahs212 が 193 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
android/nowinandroid#2112 ·
-
[FR]: Add network connectivity check before launching Chrome Custom Tab対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンenhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
android/nowinandroid#2110 ·
android/nowinandroid の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
emm3000/myGame#2175 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
MetrolistGroup/Metrolist#5426 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
🐛 Type:Bug 📥 State:Awaiting Assignment 🚨 Priority: P0 - Critical
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
backend
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
digitalfabrik/entitlementcard#3330 ·
メンテナーはふだん 2 日以内に返信