doctor: collapse healthy output to one line, add --verbose

A healthy host triggered ~20 PASS rows with details — too noisy for
the common case. Default now prints only fail/warn rows plus a
summary footer; an all-pass run collapses to a single line. Pass
--verbose / -v for the full per-check output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Thales Maciel 2026-05-01 14:18:09 -03:00
parent 09a3ef812f
commit 9b5cbed32d
No known key found for this signature in database
GPG key ID: 33112E6833C34679
4 changed files with 142 additions and 7 deletions

View file

@ -133,12 +133,15 @@ func TestDoctorCommandPrintsReportAndFailsOnHardFailures(t *testing.T) {
t.Fatalf("Execute() error = %v, want doctor failure", err)
}
output := stdout.String()
if !strings.Contains(output, "PASS\truntime bundle") {
t.Fatalf("output = %q, want runtime bundle pass", output)
if strings.Contains(output, "PASS\truntime bundle") {
t.Fatalf("output = %q, brief default should hide PASS rows", output)
}
if !strings.Contains(output, "FAIL\tfeature nat") {
t.Fatalf("output = %q, want feature nat fail", output)
}
if !strings.Contains(output, "1 passed, 0 warnings, 1 failure") {
t.Fatalf("output = %q, want summary footer", output)
}
}
func TestDoctorCommandReturnsUnderlyingError(t *testing.T) {