Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Overlap isolated guidance checks within the existing Go test budget

pulse-triage[bot]8874d8adbe4b
diff --git a/scripts/installtests/api_guidance_test.go b/scripts/installtests/api_guidance_test.go
index 8a1937dca5..c8335ff18a 100644
--- a/scripts/installtests/api_guidance_test.go
+++ b/scripts/installtests/api_guidance_test.go
@@ -172,10 +172,15 @@ func runPulseAPIRecipe(t *testing.T, script, home, bin string, extraEnv ...strin
return result.output, result.exit
}
+// These cases own their files, command environments and synthetic peers. Use
+// Go's existing -parallel budget; retain the real request/TERM/KILL deadlines
+// and begin each fixture watchdog only after its case is admitted.
func TestPulseAPIGuidancePreparationIsPrivateAndFailClosed(t *testing.T) {
+ t.Parallel()
prep, _, _ := pulseAPIReference(t)
for _, mode := range []string{"new", "existing", "config symlink", "directory symlink", "file symlink", "dangling symlink", "non-regular", "mkdir failure", "chmod failure", "touch failure", "editor failure"} {
t.Run(mode, func(t *testing.T) {
+ t.Parallel()
home, bin := t.TempDir(), t.TempDir()
dir := filepath.Join(home, ".config", "pulse")
file := filepath.Join(dir, "api-header")
@@ -281,9 +286,11 @@ func TestPulseAPIGuidancePreparationIsPrivateAndFailClosed(t *testing.T) {
}
func TestPulseAPIGuidanceHelperStopsBeforeCurlOnUnsafeFilesOrPreparation(t *testing.T) {
+ t.Parallel()
_, helper, _ := pulseAPIReference(t)
for _, mode := range []string{"missing", "file symlink", "config symlink", "directory symlink", "non-regular", "chmod failure", "mktemp failure", "unsupported method", "full URL", "extra argument"} {
t.Run(mode, func(t *testing.T) {
+ t.Parallel()
home, bin := t.TempDir(), t.TempDir()
dir := filepath.Join(home, ".config", "pulse")
if err := os.MkdirAll(dir, 0700); err != nil {
@@ -352,10 +359,12 @@ func TestPulseAPIGuidanceHelperStopsBeforeCurlOnUnsafeFilesOrPreparation(t *test
type apiRecipeRequest struct{ method, uri, token, contentType, body string }
func TestPulseAPIGuidanceCopiedRequestsKeepResponsesPrivateAndOneShot(t *testing.T) {
+ t.Parallel()
_, helper, calls := pulseAPIReference(t)
for _, call := range calls {
for _, scenario := range []string{"success", "401", "403", "redirect", "partial", "untrusted HTTPS", "trusted HTTPS"} {
t.Run(call.contract.name+"/"+scenario, func(t *testing.T) {
+ t.Parallel()
home, bin := t.TempDir(), t.TempDir()
dir := filepath.Join(home, ".config", "pulse")
if err := os.MkdirAll(dir, 0755); err != nil {
@@ -511,6 +520,7 @@ func TestPulseAPIGuidanceCopiedRequestsKeepResponsesPrivateAndOneShot(t *testing
}
func TestPulseAPIGuidanceMissingNodeInputStopsBeforeCurl(t *testing.T) {
+ t.Parallel()
_, helper, calls := pulseAPIReference(t)
home, bin := t.TempDir(), t.TempDir()
dir := filepath.Join(home, ".config", "pulse")
@@ -543,6 +553,7 @@ func TestPulseAPIGuidanceMissingNodeInputStopsBeforeCurl(t *testing.T) {
}
func TestPulseAPIGuidanceTimedOutPOSTIsNotRepeated(t *testing.T) {
+ t.Parallel()
_, helper, calls := pulseAPIReference(t)
var execute string
for _, call := range calls {
diff --git a/scripts/installtests/pbs_api_guidance_test.go b/scripts/installtests/pbs_api_guidance_test.go
index 46e6b2a245..2aa20d871d 100644
--- a/scripts/installtests/pbs_api_guidance_test.go
+++ b/scripts/installtests/pbs_api_guidance_test.go
@@ -116,10 +116,15 @@ func runPBSRecipe(t *testing.T, recipe, home, bin string, extraEnv ...string) (s
return result.output, result.exit
}
+// These cases own their files, command environments and synthetic peers. Use
+// Go's existing -parallel budget; retain the real request/TERM/KILL deadlines
+// and begin each fixture watchdog only after its case is admitted.
func TestPBSAPIGuidancePreparationIsPrivateAndFailClosed(t *testing.T) {
+ t.Parallel()
for index, filename := range []string{"pbs-agent-token", "pbs-header"} {
for _, mode := range []string{"new", "existing", "config symlink", "directory symlink", "file symlink", "dangling symlink", "non-regular", "mkdir failure", "chmod failure", "touch failure", "editor failure"} {
t.Run(filename+"/"+mode, func(t *testing.T) {
+ t.Parallel()
home := t.TempDir()
bin := filepath.Join(home, "bin")
if err := os.Mkdir(bin, 0700); err != nil {
@@ -266,6 +271,7 @@ func TestPBSAPIGuidanceRejectsUnsafeRecipesAndExactParent(t *testing.T) {
// and identifying data. This proves copied transport/file safety, not native
// PBS permissions, installed collection, backup recovery or agent installation.
func TestPBSAPIGuidanceCopiedRequestsKeepSecretsPrivate(t *testing.T) {
+ t.Parallel()
blocks := pbsAPIGuidance(t)
for index, recipe := range blocks[2:] {
for _, scenario := range []string{"success", "401", "403", "redirect", "wrong success status", "untrusted HTTPS", "truncated installer", "existing installer", "symlinked header"} {
@@ -273,6 +279,7 @@ func TestPBSAPIGuidanceCopiedRequestsKeepSecretsPrivate(t *testing.T) {
continue
}
t.Run(fmt.Sprintf("%d/%s", index, scenario), func(t *testing.T) {
+ t.Parallel()
recipe := recipe
realCurl, err := exec.LookPath("curl")
if err != nil {
diff --git a/scripts/installtests/temperature_guidance_test.go b/scripts/installtests/temperature_guidance_test.go
index 2218e604c3..4812433fd0 100644
--- a/scripts/installtests/temperature_guidance_test.go
+++ b/scripts/installtests/temperature_guidance_test.go
@@ -168,11 +168,16 @@ func TestTemperatureCleanupRecipeScopeRejectsBroaderOrMissingActions(t *testing.
}
}
+// These cases own their files, command environments and synthetic peers. Use
+// Go's existing -parallel budget; retain the real request/TERM/KILL deadlines
+// and begin each fixture watchdog only after its case is admitted.
func TestTemperatureGuidanceReadingCommandsArePrivateAndBounded(t *testing.T) {
+ t.Parallel()
local, ssh, _ := temperatureRecipes(t)
for index, recipe := range []string{local, ssh} {
for _, scenario := range []string{"success", "partial failure", "hung command", "temporary directory failure", "missing timeout"} {
t.Run(fmt.Sprintf("%d/%s", index, scenario), func(t *testing.T) {
+ t.Parallel()
home, bin, tmp := t.TempDir(), t.TempDir(), t.TempDir()
tool := "sensors"
outName, errName := "sensors.json", "sensors.err"
@@ -256,9 +261,11 @@ func TestTemperatureGuidanceReadingCommandsArePrivateAndBounded(t *testing.T) {
}
func TestTemperatureGuidanceCleanupDownloadPreservesFilesAndTrust(t *testing.T) {
+ t.Parallel()
_, _, original := temperatureRecipes(t)
for _, scenario := range []string{"success", "401", "403", "redirect", "wrong success status", "untrusted HTTPS", "truncated response", "existing helper", "helper symlink", "dangling helper", "helper directory", "configuration symlink", "pulse directory symlink", "mkdir failure", "chmod failure"} {
t.Run(scenario, func(t *testing.T) {
+ t.Parallel()
realCurl, err := exec.LookPath("curl")
if err != nil {
t.Fatal("curl is required to verify copied download guidance")