Philosophy: “Honest Coverage” over “Test Theater”.
This document defines how we test lifecycle to ensure reliability without wasting time on performative metrics.
For comprehensive coverage metrics, platform compatibility, and test status tracking, see LIMITATIONS.md.
We target High Coverage (>80%) for:
lifecycle facade.We accept Low Coverage for:
termio (requires manual Windows verification).metrics interfaces, log wrappers.The following packages are explicitly exempted from strict coverage targets:
| Package | Reason | Strategy |
|---|---|---|
pkg/core/metrics |
Interface definitions & no-op stubs. | Compile check. |
pkg/core/log |
Wrapper around slog. |
Compile check. |
procio (external) |
Heavily OS-dependent (syscalls). Extracted to standalone library. | Manual verification on Windows. Tested in procio repo. |
pkg/events/filewatch |
FS race conditions are flaky. | Integration tests. |
Runs in CI/CD on Linux, macOS, and Windows.
go test -v -race ./...
Generates the “Honest Coverage” report.
go test -coverprofile="coverage.out" ./...
go tool cover -func="coverage.out"
For termio and CONIN$ handling:
examples/interactive_dx/main.go.Ctrl+C.lifecycle.WaitForGlobal() to synchronize.goleak or internal trackers confirm 0 goroutines left after test.