feat: summarize health checks and add verbose output - #445
feat: summarize health checks and add verbose output#445federicobozzini wants to merge 2 commits into
Conversation
8357d9d to
4c85465
Compare
| }) | ||
|
|
||
| t.Run("it renders an info icon for info checks", func(t *testing.T) { | ||
| t.Run("it renders remoteproc info without suppressing the success summary", func(t *testing.T) { |
There was a problem hiding this comment.
This test now conflates two things: info icon and suppression of the success message. We should probably have a test evaluating all icons.
| func TestHealthReport(t *testing.T) { | ||
| t.Run("PlainFormat", func(t *testing.T) { | ||
| t.Run("it renders the healthy host dependencies", func(t *testing.T) { | ||
| t.Run("it renders a generic result for healthy host and target sections", func(t *testing.T) { |
There was a problem hiding this comment.
What's "a generic result"? It's not obvious to me what this is actually testing now.
We should make three cases obvious:
- renders summaries if all checks pass in verbose=true mode
- renders details of failing checks details in verbose=false mode
- renders "all good" summary and no details in verbose=false mode
| Host health.HostReport `json:"host"` | ||
| Target *health.TargetReport `json:"target,omitempty"` | ||
| TargetHint string `json:"-"` | ||
| Verbose bool `json:"-"` |
There was a problem hiding this comment.
Doesn't feel like Verbose belongs here. These are contents of a health report, verbose adds "how to print it", which doesn't belong here.
| type healthCheckSection struct { | ||
| ShowPassedSummary bool | ||
| Checks []health.HealthCheck | ||
| } | ||
|
|
||
| type healthTargetSection struct { | ||
| Destination string | ||
| Section healthCheckSection | ||
| } | ||
|
|
||
| type plainHealthReport struct { | ||
| Host healthCheckSection | ||
| Target *healthTargetSection | ||
| TargetHint string | ||
| } |
There was a problem hiding this comment.
Why do we need all these new types? What purpose do they serve? I find it a bit confusing. It could be the naming (what is plain?) or the purpose (why new types if all we do is display "All good" if all checks pass).
Signed-off-by: Federico Bozzini <federico.bozzini@arm.com>
4c85465 to
f3fced6
Compare
Changes
topo healthonly shows errors and warningstopo healthdoesn't report any issueverboseflag is introduced to report the result of all checksScreenshot
Checklist