willowtreeapps / willowtreeapps/vocable-android

No test coverage for the v6→v7 auto-migration (Version7Migration)

Open
#696 0 comments 0 reactions 0 assignees View on GitHub

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

  • MigrationTestHelper is constructed via a constructor overload that supports auto-migration specs
  • A migrate6to7 test seeds a v6 database (matching schemas/6.json) and validates the migration to v7 via Version7Migration
  • Test confirms resource_id is dropped and the resulting schema matches schemas/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 existing VocableDatabase.kt TODO) — not yet tracked
  • Testing what happens when v6→v7 encounters a NULL localized_name row specifically — covered by #694's MIGRATION_7_8 fix, which repairs that data regardless of which migration path a device took to get there

Links

  • Related: #694

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.