willowtreeapps / willowtreeapps/vocable-android
No test coverage for the v6→v7 auto-migration (Version7Migration)
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 127
- Forks
- 21
- Avg merge
- 16m
- Merged PRs (30d)
- 4
Description
Why
While adding a regression test for #694, ./gradlew :app:compileDebugAndroidTestKotlin surfaced a compiler warning on MigrationTest.kt's MigrationTestHelper construction: the deprecated constructor it uses "cannot be used to run migration tests involving auto migrations." Version7Migration (the @DeleteColumn auto-migration between schema v6 and v7, registered directly on VocableDatabase's @Database annotation) has never actually been exercised by a test — there is no migrate6to7 test in MigrationTest.kt, and the current helper setup is structurally incapable of validating one. Given the VocableDatabase.kt TODO noting schema v6 "we never released 6," this is a rarely-hit but real migration path (any device that had an internal/beta build at schema v6 and later updated) that has shipped untested.
Scope
Update MigrationTest.kt's MigrationTestHelper construction to a non-deprecated constructor overload that supports auto-migrations (passing Version7Migration as a spec), and add a migrate6to7 test validating the auto-migration runs and produces the expected v7 schema/data.
Acceptance Criteria
-
MigrationTestHelperis constructed via a constructor overload that supports auto-migration specs - A
migrate6to7test seeds a v6 database (matchingschemas/6.json) and validates the migration to v7 viaVersion7Migration - Test confirms
resource_idis dropped and the resulting schema matchesschemas/7.json - Existing
migrate5to6/migrate7to8-style tests continue to pass with the updated helper construction
Out of Scope
- Re-litigating whether
Version7Migration/schema v6 should be consolidated away entirely (per the existingVocableDatabase.ktTODO) — not yet tracked - Testing what happens when v6→v7 encounters a NULL
localized_namerow specifically — covered by #694'sMIGRATION_7_8fix, which repairs that data regardless of which migration path a device took to get there
Links
- Related: #694
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in MigrationTest.kt by reviewing the current MigrationTestHelper construction and the existing migrate5to6 and migrate7to8 tests. Check Version7Migration in VocableDatabase.kt and compare schemas/6.json with schemas/7.json. Update the helper for auto-migration specs, add migrate6to7, and verify resource_id is dropped while existing migration tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- databases, testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100