Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

Revert "desktop tests: a signed-out daemon and window are a guest now, not a wall"

0xdiego251db6fef4fb92
diff --git a/desktop/test/environment_recheck_timer_test.dart b/desktop/test/environment_recheck_timer_test.dart
index 41da32bdb..64b634a1e 100644
--- a/desktop/test/environment_recheck_timer_test.dart
+++ b/desktop/test/environment_recheck_timer_test.dart
@@ -7,23 +7,6 @@ import 'package:harness/core/local_key_value_store.dart';
import 'package:harness/settings/config_store.dart';
import 'package:harness/state/app_state.dart';
-/// Past setup a signed-out desktop boots home as a guest; this one never reaches for a real daemon.
-class _GuestApp extends AppNotifier {
- _GuestApp({
- required super.config,
- required super.authSession,
- super.configStore,
- super.cliLogin,
- super.environmentProvisioner,
- });
-
- @override
- Future<void> ensureCliDaemonReady() async {}
-
- @override
- Future<void> refreshMachines() async {}
-}
-
class _FakeCliLogin extends CliLogin {
@override
Future<CliAuthStatus> checkStatus() async =>
@@ -96,7 +79,7 @@ void main() {
mode: EnvironmentSetupMode.automatic,
);
final provisioner = _ScriptedProvisioner([review, waiting, ready]);
- final app = _GuestApp(
+ final app = AppNotifier(
config: AppConfig.dev,
authSession: AuthSession(),
configStore: ConfigStore(storage: _FakeKeyValueStore()),
@@ -116,8 +99,7 @@ void main() {
expect(provisioner.installCalls, [false, true, false]);
expect(app.environmentReadiness.isReady, isTrue);
expect(app.environmentRecheckPending, isFalse);
- expect(app.status, AppStatus.authenticated);
- expect(app.isGuest, isTrue, reason: 'signed out, a desktop opens on this computer as a guest');
+ expect(app.status, AppStatus.unauthenticated);
app.dispose();
});
}
diff --git a/desktop/test/environment_setup_screen_test.dart b/desktop/test/environment_setup_screen_test.dart
index d55898bb6..fb2494bfd 100644
--- a/desktop/test/environment_setup_screen_test.dart
+++ b/desktop/test/environment_setup_screen_test.dart
@@ -28,24 +28,6 @@ class _Login extends CliLogin {
const CliAuthStatus(loggedIn: false);
}
-/// A desktop that never reaches for a real daemon: past setup, a signed-out window boots onto home
-/// as a guest (the sign-in is a sheet raised later), the way boot_flow_widget_test's fixture does.
-class _GuestApp extends AppNotifier {
- _GuestApp({
- required super.config,
- required super.authSession,
- super.configStore,
- super.cliLogin,
- super.environmentProvisioner,
- });
-
- @override
- Future<void> ensureCliDaemonReady() async {}
-
- @override
- Future<void> refreshMachines() async {}
-}
-
class _Attempt {
_Attempt(this.install, this.progress);
final bool install;
@@ -102,8 +84,8 @@ Future<void> _mount(
),
home: ListenableBuilder(
listenable: app,
- builder: (_, _) => app.status == AppStatus.authenticated
- ? const Scaffold(body: Text('Home reached'))
+ builder: (_, _) => app.status == AppStatus.unauthenticated
+ ? const Scaffold(body: Text('Sign-in reached'))
: EnvironmentSetupScreen(notifier: app),
),
),
@@ -112,7 +94,7 @@ Future<void> _mount(
}
AppNotifier _app(_Provisioner provisioner) =>
- _GuestApp(
+ AppNotifier(
config: AppConfig.dev,
authSession: AuthSession(),
configStore: null,
@@ -244,7 +226,7 @@ void main() {
});
}
- testWidgets('Enter installs and retries once, then a signed-out desktop opens as a guest', (
+ testWidgets('Enter installs and retries once before reaching sign-in', (
tester,
) async {
final provisioner = _Provisioner();
@@ -284,8 +266,7 @@ void main() {
);
await tester.pump();
await tester.pump();
- expect(find.text('Home reached'), findsOneWidget);
- expect(app.isGuest, isTrue);
+ expect(find.text('Sign-in reached'), findsOneWidget);
expect(provisioner.attempts.map((attempt) => attempt.install), [
true,
true,
diff --git a/desktop/test/local_cli_discovery_test.dart b/desktop/test/local_cli_discovery_test.dart
index 92e1b5bb8..44ef43b6d 100644
--- a/desktop/test/local_cli_discovery_test.dart
+++ b/desktop/test/local_cli_discovery_test.dart
@@ -692,7 +692,7 @@ void main() {
// machine) exits, and the supervisor respawned it forever — every replacement starting without a
// session and exiting again, silently, for the app's whole lifetime.
test(
- 'startSupervising brings back a signed-out daemon, which now runs as a guest, and says so',
+ 'startSupervising stops respawning once the CLI reports it is signed out',
() async {
const computerId = '0123456789abcdef0123456789abcdef';
final identityFile = File('${scratch.path}/computer-id')
@@ -727,16 +727,13 @@ void main() {
await Future.delayed(const Duration(milliseconds: 300));
- // A signed-out daemon used to exit and refuse to start again, so respawning it looped forever.
- // It now starts without an account and serves this computer, so it is brought back like any
- // other, and the caller hears of the sign-out (AppNotifier acts only while still signed in).
expect(
spawnCount,
- greaterThan(0),
- reason: 'a signed-out daemon starts as a guest now',
+ 0,
+ reason: 'a signed-out daemon must never be respawned',
);
- expect(signedOutCalls, greaterThanOrEqualTo(1), reason: 'the caller is told');
- expect(timer.isActive, isTrue, reason: 'supervision goes on');
+ expect(signedOutCalls, 1, reason: 'the caller is told exactly once');
+ expect(timer.isActive, isFalse, reason: 'supervision stops for good');
},
);