From 2a7875e1a9e7e1d73fbddb33bbd1a1d110470ee4 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Wed, 13 May 2026 08:02:37 +0200 Subject: [PATCH] =?UTF-8?q?remove=20OsBridge=20openURL/reveal=20tests=20?= =?UTF-8?q?=E2=80=94=20they=20spawn=20OS=20popups?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit services_bigger_test.dart's openURL + reveal tests called the real OsBridge methods, which Process.run xdg-open / open / explorer. On a desktop session the OS dispatcher (KIO on KDE, etc.) surfaces a "Could not read file …" error dialog for the bogus URL, owned by the desktop session not the test process — it persists after the test exits and a fresh run spawns another one. The user has to manually close each popup, blocking CI from running unattended. Coverage value was minimal (anyOf(true, false)). Leaving fire() and the rest of the OsBridge bus-event surface; command-shape coverage of openURL/reveal can come from integration tests where a real OS dispatcher is desired. Co-Authored-By: Claude Opus 4.7 (1M context) --- test/kernel/src/services_bigger_test.dart | 27 +++++++---------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/test/kernel/src/services_bigger_test.dart b/test/kernel/src/services_bigger_test.dart index d3c155cf..bace5103 100644 --- a/test/kernel/src/services_bigger_test.dart +++ b/test/kernel/src/services_bigger_test.dart @@ -75,25 +75,14 @@ void main() { }); group('OsBridge', () { - test('openURL returns false for an unsupported / unknown URL', () async { - final bridge = OsBridge( - log: Logger(minLevel: LogLevel.error), - events: DaemonBus(), - ); - // Use a scheme/path that xdg-open / open won't actually handle to - // get a non-zero exit. Either an error or false is acceptable. - final ok = await bridge.openURL('clide://does-not-exist'); - expect(ok, anyOf(isFalse, isTrue)); - }); - - test('reveal returns false for an unsupported / non-existent path', () async { - final bridge = OsBridge( - log: Logger(minLevel: LogLevel.error), - events: DaemonBus(), - ); - final ok = await bridge.reveal('/tmp/clide-no-such-file-${DateTime.now().microsecondsSinceEpoch}'); - expect(ok, anyOf(isFalse, isTrue)); - }); + // openURL / reveal aren't exercised end-to-end here — they spawn + // real xdg-open / open / explorer processes, which on a desktop + // session surface a system error dialog ("Could not read file …") + // even when the URL is bogus. We're not in a sandbox that swallows + // those, so the test would visibly nag the user. Coverage of the + // command-shape branches is good enough via `fire` + the platform- + // dispatch (left to integration tests where a real OS dispatcher + // is wanted). test('fire emits an OsLifecycleEvent on the bus', () async { final bus = DaemonBus();