test: add cmd/bd helper coverage and stabilize test runner

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
Jordan Hubbard
2025-12-26 17:55:51 -04:00
parent 28f2c76589
commit 0b6ec57928
8 changed files with 318 additions and 4 deletions

View File

@@ -5,6 +5,8 @@ import (
"os/exec"
"testing"
"time"
"github.com/steveyegge/beads/internal/git"
)
// waitFor repeatedly evaluates pred until it returns true or timeout expires.
@@ -42,6 +44,7 @@ func setupGitRepo(t *testing.T) (repoPath string, cleanup func()) {
_ = os.Chdir(originalWd)
t.Fatalf("failed to init git repo: %v", err)
}
git.ResetCaches()
// Configure git
_ = exec.Command("git", "config", "user.email", "test@test.com").Run()
@@ -85,6 +88,7 @@ func setupGitRepoWithBranch(t *testing.T, branch string) (repoPath string, clean
_ = os.Chdir(originalWd)
t.Fatalf("failed to init git repo: %v", err)
}
git.ResetCaches()
// Configure git
_ = exec.Command("git", "config", "user.email", "test@test.com").Run()