Install Linux updates in place and restart

The Linux app now downloads the release archive to a temporary folder,
verifies its checksum, extracts it beside the install folder, swaps the
bundle in with two renames (keeping <install>.previous for rollback) and
relaunches. A read-only install location is reported with how to fix it.
The prompt and Settings button say "Install and restart".
This commit is contained in:
2026-11-09 19:40:52 +00:00
parent 15939fcf09
commit 277c691b2c
7 changed files with 320 additions and 34 deletions
@@ -3,30 +3,35 @@ import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/updates/launch_update_dialog.dart';
void main() {
testWidgets('desktop prompt identifies source and archive action', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
home: Builder(
builder: (context) => TextButton(
onPressed: () => showLaunchUpdateDialog(
context,
web: false,
cupertino: false,
nativePlatform: 'linux',
sourceName: 'Home Linux',
for (final (platform, sentence, action) in [
('linux', 'installs it and restarts', 'Install and restart'),
('macos', 'extract the archive', 'Download'),
]) {
testWidgets('$platform prompt identifies source and its action', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
home: Builder(
builder: (context) => TextButton(
onPressed: () => showLaunchUpdateDialog(
context,
web: false,
cupertino: false,
nativePlatform: platform,
sourceName: 'Home Linux',
),
child: const Text('Check'),
),
child: const Text('Check'),
),
),
),
);
await tester.tap(find.text('Check'));
await tester.pumpAndSettle();
expect(find.textContaining('from Home Linux'), findsOneWidget);
expect(find.textContaining('extract the archive'), findsOneWidget);
expect(find.text('Download'), findsOneWidget);
expect(find.textContaining('Android'), findsNothing);
});
);
await tester.tap(find.text('Check'));
await tester.pumpAndSettle();
expect(find.textContaining('from Home Linux'), findsOneWidget);
expect(find.textContaining(sentence), findsOneWidget);
expect(find.text(action), findsOneWidget);
expect(find.textContaining('Android'), findsNothing);
});
}
}