2024/10/25
laprasdrum.icon 週末は旅行
/icons/hr.icon
AndroidはJUnit5対応難しいみたい
The primary hurdle lies in the deep-rooted integration of JUnit4 within the Android testing ecosystem. Our AndroidX Test libraries, Compose Test, and Benchmark libraries all rely heavily on JUnit4's rules and runners. While creating JUnit5-compatible artifacts is technically achievable, there are clear challenges in the process.
To seamlessly support JUnit5, we would need to embark on a substantial undertaking:
Revamp the Core: Adapt the existing test runner or build a new one to proficiently discover and execute JUnit5 tests.
Parallel APIs: Develop a parallel set of JUnit5 APIs to mirror the functionality of the current JUnit4-based AndroidX Test APIs (e.g., ActivityScenarioRule).
Continuous Maintenance: Commit to ongoing maintenance efforts, including adding JUnit5 equivalents for every new API we introduce.
Robolectric Migration: Assist in migrating the Robolectric framework to support JUnit5, as it's currently tightly coupled with JUnit4.
On top of those reasons, it is important to note that Google’s own internal testing infrastructure relies heavily on these same libraries. We want to maintain a level of uniformity within Google’s own infrastructure, and migrating to JUnit5 APIs will be a large and separate undertaking.