Fix integration test compilation errors in cmd/bd

The integration tests were failing to compile due to several issues
introduced by API changes that weren't reflected in the test files:

1. daemon_test.go:
   - getPIDFilePath() signature changed: removed boolean parameter
   - getLogFilePath() signature changed: removed boolean parameter
   - Removed duplicate windowsOS constant (already in test_helpers_test.go)

2. daemon_parent_test.go:
   - Removed duplicate runGitCmd() function (already in git_sync_test.go
     with more functionality including date env vars)
   - Removed unused os/exec import

These fixes allow `go test -tags integration ./cmd/bd` to compile
successfully. The test suite can now be run to verify daemon and
sync branch functionality.

No behavioral changes - only fixing test compilation issues.
This commit is contained in:
Charles P. Cross
2025-12-11 07:11:15 -05:00
parent c9dc0276aa
commit eaec440358
2 changed files with 4 additions and 11 deletions

View File

@@ -4,7 +4,6 @@
package main
import (
"os/exec"
"path/filepath"
"testing"
)
@@ -39,10 +38,4 @@ func mustAbs(t *testing.T, path string) string {
return abs
}
func runGitCmd(t *testing.T, dir string, args ...string) {
cmd := exec.Command("git", args...)
cmd.Dir = dir
if err := cmd.Run(); err != nil {
t.Fatalf("git %v failed: %v", args, err)
}
}
// runGitCmd is defined in git_sync_test.go

View File

@@ -23,7 +23,7 @@ import (
"github.com/steveyegge/beads/internal/types"
)
const windowsOS = "windows"
// windowsOS constant moved to test_helpers_test.go
func initTestGitRepo(t testing.TB, dir string) {
t.Helper()
@@ -70,7 +70,7 @@ func TestGetPIDFilePath(t *testing.T) {
defer func() { dbPath = oldDBPath }()
dbPath = filepath.Join(tmpDir, ".beads", "test.db")
pidFile, err := getPIDFilePath(false) // test local daemon
pidFile, err := getPIDFilePath()
if err != nil {
t.Fatalf("getPIDFilePath failed: %v", err)
}
@@ -118,7 +118,7 @@ func TestGetLogFilePath(t *testing.T) {
defer func() { dbPath = oldDBPath }()
dbPath = dbFile
result, err := getLogFilePath(userPath, false) // test local daemon
result, err := getLogFilePath(userPath)
if err != nil {
t.Fatalf("getLogFilePath failed: %v", err)
}