test: hosts, routes, serve coverage and URL integration#17
Conversation
- Unit-test resolveRequestedHosts and daemon info lookup over net.Pipe - Exercise runRoutes against a minimal Unix socket stub - Cover resolveServeSocketPath invalid config and socket precedence - Add integration test for url inheriting daemon domain; fix run test for --name Made-with: Cursor
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Review SummaryThis PR adds good test coverage for hostname resolution, daemon info lookup, and socket path resolution. All tests pass and code is properly formatted. Assessment: LGTM Changes Reviewed
Verification
|
|
Good set of tests. All unit tests pass. A few observations:
Necessary correctness fix — the old
Env isolation is correct: clearing
The stub goroutine handles a single connection and exits. Since One minor nit: the stub swallows errors silently ( go func() {
conn, err := ln.Accept()
if err != nil {
t.Errorf("stub accept: %v", err)
return
}
...
}()
Tests cover the key branching in One nit:
Correctly structured and consistent with existing integration tests. Uses Style nit: The binary-build block (lines 249–253) is now copy-pasted three times across the integration test file. Worth extracting into a Overall this is solid work. No bugs or correctness issues found. |

Adds unit tests for hostname resolution and daemon info lookup, a
runRoutestable test with a stub Unix socket, andresolveServeSocketPathcases (invalid config, config socket vs flag).Includes an integration test that runs
hostmux urlagainst a foreground daemon so daemon-domain expansion is exercised end-to-end. Updates the existing domain-inheritance integration test to userun --name api, matching the current CLI.Verification
go test ./... -count=1go test -tags=integration -count=1 ./...go vet ./...Made with Cursor