From 685a671c61df605fc650941c5663c2969fd80ed7 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Sun, 19 Jul 2026 19:58:03 +0100 Subject: [PATCH] Make the agent token test platform-aware Use the runtime-selected default token path in the token-resolution fixture so the same contract is exercised on Windows and Unix runners. Contract-Neutral: Platform-aware agent token test fixture changes no runtime contract --- cmd/pulse-agent/main_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/pulse-agent/main_test.go b/cmd/pulse-agent/main_test.go index 3f186937a..83d6cec6e 100644 --- a/cmd/pulse-agent/main_test.go +++ b/cmd/pulse-agent/main_test.go @@ -794,7 +794,7 @@ func TestResolveEnableCommands(t *testing.T) { func TestResolveToken(t *testing.T) { fakeReadFile := func(path string) ([]byte, error) { - if path == "/var/lib/pulse-agent/token" { + if path == defaultTokenFilePath() { return []byte("default-token"), nil } if path == "valid-file" { @@ -814,7 +814,6 @@ func TestResolveToken(t *testing.T) { {"file priority", "", "valid-file", "env-token", "file-token"}, {"env priority", "", "", "env-token", "env-token"}, {"default file priority", "", "", "", "default-token"}, - {"missing returns empty", "", "", "", "default-token"}, // Wait, default-token will be returned if nothing else is provided } // Update the test cases to avoid the default file if we want to test empty