Introduced Room Migration Tests - Tests added for Migration 9 -> 10#4787
Introduced Room Migration Tests - Tests added for Migration 9 -> 10#4787atharvyadav22 wants to merge 7 commits intokiwix:mainfrom
Conversation
…oad is ongoing. * Introduced event-based scroll handling instead of relying on condition-based list position changes. This separates scroll behavior from list changes and makes the architecture more clear and maintainable. * The list now scrolls to the top only when a fresh set of items is fetched from the online source (e.g., after applying search, filters, category, or language changes). * The current scroll position is preserved during download progress updates and pagination (load more).
|
This commit is all about setup would add tests later |
|
What is the status here? |
There was a problem hiding this comment.
Pull request overview
Adds Room schema export artifacts and Gradle wiring intended to support validating the MIGRATION_9_10 change (new pauseReason column) via Room migration tests.
Changes:
- Enabled Room schema export for
KiwixRoomDatabaseand committed schema snapshots for versions 9 and 10. - Configured the
coremodule to expose the schema directory asandroidTestassets and added the Room testing dependency. - Added a
roomTestingdependency coordinate tobuildSrcLibs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| core/src/main/java/org/kiwix/kiwixmobile/core/data/KiwixRoomDatabase.kt | Enables exportSchema so Room can emit schema JSON for migration validation. |
| core/schemas/org.kiwix.kiwixmobile.core.data.KiwixRoomDatabase/9.json | Adds Room schema snapshot for DB version 9. |
| core/schemas/org.kiwix.kiwixmobile.core.data.KiwixRoomDatabase/10.json | Adds Room schema snapshot for DB version 10 (includes pauseReason). |
| core/build.gradle.kts | Adds room-testing, wires schemas into androidTest assets, and sets Room schema export location. |
| buildSrc/src/main/kotlin/Libs.kt | Introduces Libs.roomTesting constant. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -62,4 +68,11 @@ dependencies { | |||
| implementation(Libs.kotlinx_coroutines_android) | |||
| implementation(Libs.zxing) | |||
| testImplementation(Libs.TURBINE_FLOW_TEST) | |||
| androidTestImplementation(Libs.roomTesting) | |||
| } | |||
There was a problem hiding this comment.
The PR title/description indicate migration tests were introduced, but there are no androidTest sources in this module (and no usages of MigrationTestHelper / runMigrationsAndValidate found in the repo). As-is, this adds schema assets and the room-testing dependency but doesn't actually validate MIGRATION_9_10. Either add the migration test(s) (e.g., under core/src/androidTest/...) or adjust the PR title/description to reflect that this PR only enables schema export and adds schema snapshots.
| } | ||
| plugins { | ||
| `android-library` | ||
| kotlin("kapt") |
There was a problem hiding this comment.
kotlin("kapt") is redundant here because KiwixConfigurationPlugin already applies kotlin-kapt (and kotlin-android) to all modules. Applying kapt directly in the plugins block without also applying the Kotlin Android plugin can also fail depending on plugin application order. Consider removing this line and relying on the convention plugin, keeping only the kapt { arguments { ... } } block below.
| kotlin("kapt") |
|
@kelson42 |
Fixes: #4784
This PR focuses on migration tests for 9 to 10 which introduced