Skip to content

Add functional and database compatibility test coverage - #7

Merged
sljeff merged 2 commits into
mainfrom
codex/test-compat-ci
Jul 31, 2026
Merged

Add functional and database compatibility test coverage#7
sljeff merged 2 commits into
mainfrom
codex/test-compat-ci

Conversation

@sljeff

@sljeff sljeff commented Jul 31, 2026

Copy link
Copy Markdown
Owner

What changed

  • Add focused unit tests for API/model mapping and formatting behavior.
  • Add behavior-driven controller tests for subscriptions, playback, subtitle generation, and translation.
  • Exercise controller lifecycle wiring, async persistence ordering, queue completion, progress saving, retry/deduplication, and failure paths through injectable production seams.
  • Persist in-progress subtitle rows so generation can resume after restart, and verify that state through real SQLite fresh-create, released-schema upgrade, and reopen paths.
  • Add independent SQLite schema v3 and v4 fixtures.
  • Exercise real upgrades to the current schema, seed parity, released-row preservation, current model read/write, reopen idempotency, and migration rollback.
  • Await schema creation, seed initialization, and migrations so database open cannot complete early.
  • Split functional unit tests and backward-compatibility regression tests into separate CI steps.

Why

The app is already shipped, so both runtime controller behavior and persisted-data compatibility need stable regression coverage. Historical database fixtures provide an upgrade oracle independent of the current schema, while the controller tests exercise real branching and async behavior instead of only construction or static constants.

Impact

There is no database version bump in this PR. Existing schema v3 and v4 databases continue upgrading through the current v4 migration. In-progress subtitle state can now survive an app restart. The controller changes also prevent null subscription identifiers from matching, duplicate in-flight translation requests, starvation of later translation work after one failure, and leaked player timers/audio subscriptions.

Validation

  • flutter pub get --enforce-lockfile
  • flutter analyze --no-fatal-infos (passes; 12 pre-existing info-level lints)
  • flutter test --coverage — 78 tests passed
  • Loaded application-source line coverage for this controller-test batch: 15.0% (741/4943) → 18.4% (926/5019), adding 185 covered production lines
  • Core controller coverage, previously 0%: PlayerController 61.0%, SubscriptionController 63.2%, SubtitleController 89.1%, TranslationController 75.9%
  • Isolated fault-injection checks confirmed the suites reject missing migrations, destructive settings resets, incorrect historical boolean decoding, dropped processing subtitles, duplicate translation requests, leaked player resources, and null subscription collisions.

@sljeff
sljeff marked this pull request as ready for review July 31, 2026 12:05
@sljeff
sljeff merged commit 507daad into main Jul 31, 2026
6 checks passed
@sljeff
sljeff deleted the codex/test-compat-ci branch July 31, 2026 12:08
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.

1 participant