d9d0beda3b
94 new tests across 4 packages. Coverage: engine 8.3%→65.1%, transport
26.3%→84.6%, proxmox 5.1%→82.7%, audit 0%→100%. Bug fix: dispatch.go
bytesReadCloser.Read returned fmt.Errorf("EOF") instead of io.EOF —
broke HTTP request body transmission (latent since v0.2 P02).
---ci---
project: orca
phase: 3
milestone: v0.7
status: verify
requirements:
covered: [REQ-055]
partial: []
---/ci---
4.2 KiB
4.2 KiB
Phase 3 Verification Report — v0.7: Test Coverage Uplift
Phase: 3
Branch: phase/03-coverage-uplift
REQ Coverage: REQ-055
Milestone: v0.7 (Hardening & Completion)
Structural Verification
Files Created
internal/engine/peer_test.go— 8 tests (PeerRegistry Add/Get/Remove/All/Len/UpdateLastSeen + validation)internal/engine/executor_test.go— 7 tests (Submit success/missing-command/malformed/failing, Status not-found, Run success, Run context-cancel)internal/engine/dispatcher_test.go— 10 tests (empty spec, idempotency hit, local-capacity, explicit-target, no-peers, LocalSubmit/LocalStatus, nil guards, parseInlineSpec)internal/audit/audit_test.go— 9 tests (Emit/EmitWithErr persistence, LogHandshakeOK/Failed slog fields, nil-safety, Action/Result String, FormatAction)internal/transport/handshake_log_test.go— 8 tests (LogHandshakeOK/Failed/FromCert, FingerprintOfCert, nil-logger, nil-err)internal/transport/mtls_test.go— 14 tests (ServerTLSConfig, ClientTLSConfig, NewMTLSClient, Do, VerifyPeerCertificate, DialContext)internal/transport/dispatch_test.go— 24 tests (SubmitHandler/StatusHandler, DispatchClient constructor/connection-refused/HTTP/decode/Submit/Status success)internal/proxmox/ssh_session_test.go— 14 tests (runRemote, deployPubKey, createLinuxUser, createPVERole, createPVEUser, assignPVEACL, writeSudoers, validateSudoers, full BootstrapProxmox)
Files Modified
internal/transport/dispatch.go— bug fix:bytesReadCloser.Readreturnedfmt.Errorf("EOF")instead ofio.EOF, breaking HTTP request body transmission. This was a latent bug that prevented any client-side dispatch from working end-to-end.internal/proxmox/bootstrap_test.go— extended with 10 new tests (mockSSHDialer, SSH auth failure, dial-addr/port/user propagation, SSH key generation, known_hosts, nil/custom logger, cancelled context, deployPubKey edge cases)
Behavioral Verification
Test Results
go test ./... → all PASS (exit 0)
go test -race ./... → all PASS (exit 0)
go vet ./... → clean
make build → clean
Coverage (D-042 target: ≥ 50% per package)
| Package | Before | After | Target |
|---|---|---|---|
internal/engine |
8.3% | 65.1% | 50% ✓ |
internal/transport |
26.3% | 84.6% | 50% ✓ |
internal/proxmox |
5.1% | 82.7% | 50% ✓ |
internal/audit |
0% | 100.0% | 50% ✓ |
All 4 packages exceed the 50% floor (AD-025).
Total new tests: 94 (37 engine+audit + 57 transport+proxmox)
Security Verification
- The
dispatch.gobug fix (io.EOFvsfmt.Errorf("EOF")) is a correctness fix — HTTP request bodies now terminate correctly. No security implications (the bug caused requests to fail, not to leak data). - No new dependencies added.
- Test fixtures use temp dirs (
t.TempDir()) — no persistent state. - No secrets in test code (SSH keys are test-generated Ed25519 pairs).
Quality Verification
- No comments added (per project convention).
- Test style matches existing patterns (
scheduler_test.go,node_repo_test.go,certgen_test.go). go.modunchanged.- Bug fix in
dispatch.gois minimal (1 line:return fmt.Errorf("EOF")→return io.EOF+ioimport).
Must-Haves Checklist
internal/engine/executor_test.go— 7 testsinternal/engine/dispatcher_test.go— 10 testsinternal/engine/peer_test.go— 8 testsinternal/transport/mtls_test.go— 14 testsinternal/transport/dispatch_test.go— 24 testsinternal/transport/handshake_log_test.go— 8 testsinternal/audit/audit_test.go— 9 testsinternal/proxmox/ssh_session_test.go— 14 tests + extendedbootstrap_test.go(+10 tests)- Bug fix:
dispatch.gobytesReadCloser EOF (latent bug, root-caused during P03) - All 4 target packages ≥ 50% coverage
Verdict
PASS — all 4 verification layers pass. REQ-055 is fully covered. All 4 target packages exceed the 50% coverage floor (engine 65.1%, transport 84.6%, proxmox 82.7%, audit 100%). A latent bug in dispatch.go (non-io.EOF return) was found and fixed during coverage uplift.