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:
@@ -4,7 +4,6 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os/exec"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
@@ -39,10 +38,4 @@ func mustAbs(t *testing.T, path string) string {
|
|||||||
return abs
|
return abs
|
||||||
}
|
}
|
||||||
|
|
||||||
func runGitCmd(t *testing.T, dir string, args ...string) {
|
// runGitCmd is defined in git_sync_test.go
|
||||||
cmd := exec.Command("git", args...)
|
|
||||||
cmd.Dir = dir
|
|
||||||
if err := cmd.Run(); err != nil {
|
|
||||||
t.Fatalf("git %v failed: %v", args, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
"github.com/steveyegge/beads/internal/types"
|
"github.com/steveyegge/beads/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
const windowsOS = "windows"
|
// windowsOS constant moved to test_helpers_test.go
|
||||||
|
|
||||||
func initTestGitRepo(t testing.TB, dir string) {
|
func initTestGitRepo(t testing.TB, dir string) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
@@ -70,7 +70,7 @@ func TestGetPIDFilePath(t *testing.T) {
|
|||||||
defer func() { dbPath = oldDBPath }()
|
defer func() { dbPath = oldDBPath }()
|
||||||
|
|
||||||
dbPath = filepath.Join(tmpDir, ".beads", "test.db")
|
dbPath = filepath.Join(tmpDir, ".beads", "test.db")
|
||||||
pidFile, err := getPIDFilePath(false) // test local daemon
|
pidFile, err := getPIDFilePath()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("getPIDFilePath failed: %v", err)
|
t.Fatalf("getPIDFilePath failed: %v", err)
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ func TestGetLogFilePath(t *testing.T) {
|
|||||||
defer func() { dbPath = oldDBPath }()
|
defer func() { dbPath = oldDBPath }()
|
||||||
dbPath = dbFile
|
dbPath = dbFile
|
||||||
|
|
||||||
result, err := getLogFilePath(userPath, false) // test local daemon
|
result, err := getLogFilePath(userPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("getLogFilePath failed: %v", err)
|
t.Fatalf("getLogFilePath failed: %v", err)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user