Repository navigation
test(cli): cover auth, connection status, proxy startup, and replay shard formatting - #3437
Conversation
…hard formatting Drives the five CRAP findings in #3420 through their owning command entry points: auth status/login/logout rendering, the connection status human block, the proxy command's daemon-backed startup and loopback bind, and replay-test shard device-name suffixes.
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Review follow-up: record the arguments the command passes to the proxy server's listen so the --proxy-host/--proxy-port test cannot pass on defaults, and pin the absence of the deferred Metro notice in the bound-lease connection status case.
|
The PR is ready at f78c2a1. The code is correct, all 18 checks pass, and the diff only adds test files, so no production route changes. There are no conflicts, and nothing else needs to happen before merge. Not blocking, and you can take or leave these: the proxy test mocks The two cubic-dev-ai threads no longer apply, so you can resolve them. The proxy flags test now asserts the exact listen args and the URL port suffix (#3437 (comment)). The bound-lease test now has the I did not run the tests or the coverage tool, so I have not reproduced the CRAP score drops or the mutation-check claim. I also did not check how long the login test takes, since auth-session sleeps between polls. The first poll returns approved, and CI is green. |
Move the auth command test beside connection and proxy, assert the command's render closure against the exported renderProxyStartup payload, and replace the proxy test's blind client cast with a typed stub that throws on any access.
|
Review items addressed in af9efc5:
Reserved-port rebind race left as agreed. Still test-only: 4 files, 575 gross lines. |
|
Summary
Burns down the five coverage-based CRAP findings in #3420 with tests only — no production changes. Each finding is driven through its owning command's real entry point (CLI capture for
auth/connection, theproxyCommandhandler, and theformat.tsdisplay-name exports).auth.ts:44renderAuthStatusauth.ts:7authCommandconnection.ts:353status render arrowproxy.ts:32startProxyformat.ts:139replayTestShardDeviceNameNew tests:
cli/commands/__tests__/{auth,connection,proxy}.test.tsandreplay-test/reporters/__tests__/format.test.ts(575 gross lines, test-only). Mutation-checked: removing the deviceId fallback fails the format test; hardcoding the proxy bind fails the flag test.Closes #3420. Part of #3414.
Validation
Tested SHA:
af9efc5b2.pnpm check:affected --runpasses locally under the machine lock on this head.pnpm check:coverage-crap --allon the partial map over the four owned files: no function at or above 30 (was 5).check:quickandpnpm formatclean; full CI (including Coverage and Integration Tests) green on the previous headf78c2a197, re-running on this one. No provider-facing code touched.