Skip to content

Add DB schema regression tests - #675

Merged
aj3423 merged 1 commit into
aj3423:masterfrom
Kismettum:test/db-schema-regression
Sep 23, 2026
Merged

aj3423 merged 1 commit into
aj3423:masterfrom
Kismettum:test/db-schema-regression

Conversation

@Kismettum

Copy link
Copy Markdown
Contributor

Closes #672.

Adds an instrumentation regression test for database schema drift.

The test covers:

  • Fresh installs by opening a dedicated test database through SQLiteOpenHelper and checking that each current table contains every column used by its table adapter.
  • Supported upgrades by creating a frozen v4.20 / DB_VERSION 41 schema, opening it through the current Db upgrade path, and checking the same contracts afterwards.

The expected columns are derived from the existing table adapters' toContentValues() implementations rather than maintaining a separate copy of the current schema.

The test uses isolated temporary databases and mocks isFreshInstall() so it does not modify the app database or create notification channels.

The v4.20 fixture is intended to remain unchanged while that release is inside the supported upgrade window, then be replaced by a newer release baseline when the compatibility window advances.

No production-code changes or new dependencies.

Validation performed before opening this PR:

  • reviewed against current master
  • static Kotlin/API-shape compilation against matching stubs
  • independent SQLite simulation of the v4.20 → current schema path

I have not run the Android instrumentation test on a real/emulated Android device in my environment.

@aj3423

aj3423 commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Looks nice. Thanks.

@aj3423
aj3423 merged commit eac7b06 into aj3423:master Sep 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DB schema regression tests for fresh installs and supported upgrades?

2 participants