mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-25 04:33:03 +00:00
refactor: split host alert checker
Move host-agent identity, metric projection, disk/SMART/RAID/Unraid health handling, cleanup, and offline lifecycle into internal/alerts/host.go. Keep shared health-assessment evaluation package-level for now because storage ZFS and host SMART/RAID still share that bridge, while recording host.go as the host checker owner in the alerts subsystem contract. Proof: go test ./internal/alerts/...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -316,6 +316,15 @@ func TestNodeDisplayNameCacheKeyTrimsParts(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestHostResourceIDTrimsID(t *testing.T) {
|
||||
if got := hostResourceID(" host-1 "); got != "agent:host-1" {
|
||||
t.Fatalf("hostResourceID() = %q, want %q", got, "agent:host-1")
|
||||
}
|
||||
if got := hostResourceID(" \t "); got != "agent:unknown" {
|
||||
t.Fatalf("blank hostResourceID() = %q, want %q", got, "agent:unknown")
|
||||
}
|
||||
}
|
||||
|
||||
func TestQuietHoursCategoryForResourceIncidentUsesIncidentCategoryMetadata(t *testing.T) {
|
||||
availability := &Alert{
|
||||
Type: "resource-incident",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user