carlos / platform Public

e2e: no-console login follows the config default, never production

TestAuthCLI still asserted the deleted refusal, so the subprocess fell
through login's new built-in flagship fallback and polled the REAL
console until the device code expired — a 10-minute hang in go test
and a stray device-code start against production per run. Point a
config default at the fake console instead: the chain is exercised,
the network is never crossed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxXEWoRXU8WVTXjTJypuJ5
Paul Campbell 2364daf3dfb0cdc3ed4bc4db514ecf5d5c2ee757 parent dc670a2
1 file changed, +17 −7
  • auth_e2e_test.go +17 −7
diff --git a/auth_e2e_test.go b/auth_e2e_test.go
index c0a3339de..09cc0341c 100644
--- a/auth_e2e_test.go
+++ b/auth_e2e_test.go
@@ -63,16 +63,26 @@ func TestAuthCLI(t *testing.T) {
return string(out), err
}
- // A login with no console at all refuses, and names both ways out.
- out, err := run("auth", "login")
- if err == nil {
- t.Fatalf("carlos auth login with no -console exited 0:\n%s", out)
+ // A login with no console anywhere now lands on the BUILT-IN default —
+ // the production flagship — which this test must never talk to. Prove
+ // the default chain is consulted without crossing the network: a config
+ // default in the scratch home points at the fake console, and login
+ // with no -console follows it.
+ if err := os.MkdirAll(filepath.Join(home, ".carlos"), 0o755); err != nil {
+ t.Fatal(err)
}
- if !strings.Contains(out, "-console") || !strings.Contains(out, "-owner") {
- t.Fatalf("refusal does not name both options:\n%s", out)
+ if err := os.WriteFile(filepath.Join(home, ".carlos", "config"),
+ []byte(`{"console": "`+fc.ts.URL+`"}`+"\n"), 0o644); err != nil {
+ t.Fatal(err)
}
-
fc.approved.Store(true)
+ out, err := run("auth", "login", "-label", "e2e@box")
+ if err != nil {
+ t.Fatalf("carlos auth login via config default: %v\n%s", err, out)
+ }
+ if !strings.Contains(out, fc.ts.URL) {
+ t.Fatalf("login did not follow the config default to the fake console:\n%s", out)
+ }
out, err = run("auth", "login", "-console", fc.ts.URL, "-label", "e2e@box")
if err != nil {
t.Fatalf("carlos auth login: %v\n%s", err, out)