test(flutter): re-enable drift tests after ci-flutter:1.26 ships libsqlite3-0

Drops the libsqlite3-missing skip cohort now that the ci-flutter
runner image installs libsqlite3-0 (CI-runner commit on its main).

Per-file removals (no behavior change in tests themselves — they
just stop being skipped):
- `@Tags(['drift'])` + `library;` directive from 5 files.
- `const _skipDrift = ...;` declaration + its rationale comment
  from 6 files (the 5 above + like_button_test.dart, which had its
  own _skipDrift for the rollback-via-drift case).
- `skip: _skipDrift` annotations from 17 test invocations across
  those 6 files (16 single-line + 1 multi-line in like_button).
- Stale `@Tags(['drift']) tier covers it` reference in
  home_screen_test.dart's drift-coverage comment.

Net -79 +18 lines across 7 files; 17 previously-silent tests are
now part of the CI signal. Fable #399.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-20 18:02:17 -04:00
parent 461c6bf514
commit 85183c455a
7 changed files with 18 additions and 79 deletions
+5 -12
View File
@@ -1,6 +1,3 @@
@Tags(['drift'])
library;
import 'dart:io';
import 'package:dio/dio.dart';
@@ -11,13 +8,10 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:minstrel/cache/audio_cache_manager.dart';
import 'package:minstrel/cache/db.dart';
// See sync_controller_test.dart for the same skip rationale.
const _skipDrift = 'libsqlite3 missing on flutter-ci runner; on-device covers';
AppDb _testDb() => AppDb(NativeDatabase.memory());
void main() {
test('isCached returns false when no row exists', skip: _skipDrift, () async {
test('isCached returns false when no row exists', () async {
final db = _testDb();
addTearDown(db.close);
final mgr = AudioCacheManager(
@@ -29,7 +23,7 @@ void main() {
expect(await mgr.pathFor('nonexistent'), null);
});
test('usageBytes sums sizeBytes across rows', skip: _skipDrift, () async {
test('usageBytes sums sizeBytes across rows', () async {
final db = _testDb();
addTearDown(db.close);
final tmp = Directory.systemTemp.createTempSync();
@@ -55,8 +49,7 @@ void main() {
expect(await mgr.usageBytes(), 350);
});
test('rolling cap evicts non-liked LRU; liked protected',
skip: _skipDrift, () async {
test('rolling cap evicts non-liked LRU; liked protected', () async {
final db = _testDb();
addTearDown(db.close);
final tmp = Directory.systemTemp.createTempSync();
@@ -108,7 +101,7 @@ void main() {
expect(await mgr.isCached('lik'), true); // liked, protected
});
test('clearAll removes everything including manual', skip: _skipDrift, () async {
test('clearAll removes everything including manual', () async {
final db = _testDb();
addTearDown(db.close);
final tmp = Directory.systemTemp.createTempSync();
@@ -133,7 +126,7 @@ void main() {
expect(await mgr.isCached('man'), false);
});
test('unpin removes index row + deletes file', skip: _skipDrift, () async {
test('unpin removes index row + deletes file', () async {
final db = _testDb();
addTearDown(db.close);
final tmp = Directory.systemTemp.createTempSync();
+4 -16
View File
@@ -1,6 +1,3 @@
@Tags(['drift'])
library;
import 'package:dio/dio.dart';
import 'package:drift/native.dart' show NativeDatabase;
import 'package:flutter_riverpod/flutter_riverpod.dart';
@@ -11,15 +8,6 @@ import 'package:minstrel/cache/db.dart';
import 'package:minstrel/cache/sync_controller.dart';
import 'package:minstrel/library/library_providers.dart' show dioProvider;
// SKIP NOTE (#357 plan B follow-up): drift's NativeDatabase needs the
// system libsqlite3.so. The flutter-ci runner image doesn't ship it, so
// every test in this file errors with "Failed to load dynamic library
// 'libsqlite3.so'". Unblock by either:
// (a) adding libsqlite3-dev to the CI-Runner/CI-flutter image, or
// (b) using sqlite3/wasm + the wasm executor for VM tests.
// Until then, real coverage lives in on-device verification.
const _skipDrift = 'libsqlite3 missing on flutter-ci runner; on-device covers';
/// Builds a Dio whose adapter resolves every request to the supplied
/// status code + body. Avoids touching the network in tests.
Dio _stubDio({required int status, dynamic body}) {
@@ -42,7 +30,7 @@ ProviderContainer _container({required AppDb db, required Dio dio}) {
}
void main() {
test('204 advances lastSyncAt without changing cursor', skip: _skipDrift, () async {
test('204 advances lastSyncAt without changing cursor', () async {
final db = AppDb(NativeDatabase.memory());
addTearDown(db.close);
@@ -56,7 +44,7 @@ void main() {
expect(meta?.lastSyncAt, isNotNull);
});
test('200 with artist upsert writes drift row + advances cursor', skip: _skipDrift, () async {
test('200 with artist upsert writes drift row + advances cursor', () async {
final db = AppDb(NativeDatabase.memory());
addTearDown(db.close);
@@ -85,7 +73,7 @@ void main() {
expect(meta?.cursor, 7);
});
test('200 with track delete removes the row', skip: _skipDrift, () async {
test('200 with track delete removes the row', () async {
final db = AppDb(NativeDatabase.memory());
addTearDown(db.close);
@@ -115,7 +103,7 @@ void main() {
expect(track, isNull);
});
test('like_track upsert + delete round-trip', skip: _skipDrift, () async {
test('like_track upsert + delete round-trip', () async {
final db = AppDb(NativeDatabase.memory());
addTearDown(db.close);