Improve service checks and system health details

This commit is contained in:
Maxim
2026-08-01 12:21:26 +03:00
parent 980f69cf8f
commit d3fbbf2a6b
6 changed files with 184 additions and 67 deletions

View File

@@ -27,3 +27,14 @@ func TestValidateServiceAllowsLocalAddress(t *testing.T) {
t.Fatal(err)
}
}
func TestValidateServiceChecksBothHTTPAddresses(t *testing.T) {
v := MonitoredService{Name: "Gitea", URL: "https://git.example.test", LocalAddress: "192.168.0.6:3000", CheckType: "http", TimeoutSeconds: 5}
if err := validateService(v); err == nil {
t.Fatal("expected invalid local HTTP address")
}
v.LocalAddress = "https://192.168.0.6:3000"
if err := validateService(v); err != nil {
t.Fatal(err)
}
}