From e1c248bb7a1947c02f7f5946ba10b0ca1166b0c0 Mon Sep 17 00:00:00 2001 From: Steve Yegge Date: Sun, 2 Nov 2025 08:10:43 -0800 Subject: [PATCH] fix: Use correct bd binary path for Windows tests - Add getBDPath() helper to return bd.exe on Windows, bd on Unix - Fixes TestHashIDs_MultiCloneConverge and TestHashIDs_IdenticalContentDedup on Windows CI --- beads_hash_multiclone_test.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/beads_hash_multiclone_test.go b/beads_hash_multiclone_test.go index 82586b17..c40d0439 100644 --- a/beads_hash_multiclone_test.go +++ b/beads_hash_multiclone_test.go @@ -5,22 +5,31 @@ import ( "os" "os/exec" "path/filepath" + "runtime" "strings" "testing" ) +// getBDPath returns the correct path to the bd binary for the current OS +func getBDPath() string { + if runtime.GOOS == "windows" { + return "./bd.exe" + } + return "./bd" +} + // TestHashIDs_MultiCloneConverge verifies that hash-based IDs work correctly // across multiple clones creating different issues. With hash IDs, each unique // issue gets a unique ID, so no collision resolution is needed. func TestHashIDs_MultiCloneConverge(t *testing.T) { tmpDir := t.TempDir() - bdPath, err := filepath.Abs("./bd") + bdPath, err := filepath.Abs(getBDPath()) if err != nil { t.Fatalf("Failed to get bd path: %v", err) } if _, err := os.Stat(bdPath); err != nil { - t.Fatalf("bd binary not found at %s - run 'go build -o bd ./cmd/bd' first", bdPath) + t.Fatalf("bd binary not found at %s - run 'go build -v ./cmd/bd' first", bdPath) } // Setup remote and 3 clones @@ -79,12 +88,12 @@ func TestHashIDs_MultiCloneConverge(t *testing.T) { func TestHashIDs_IdenticalContentDedup(t *testing.T) { tmpDir := t.TempDir() - bdPath, err := filepath.Abs("./bd") + bdPath, err := filepath.Abs(getBDPath()) if err != nil { t.Fatalf("Failed to get bd path: %v", err) } if _, err := os.Stat(bdPath); err != nil { - t.Fatalf("bd binary not found at %s - run 'go build -o bd ./cmd/bd' first", bdPath) + t.Fatalf("bd binary not found at %s - run 'go build -v ./cmd/bd' first", bdPath) } // Setup remote and 2 clones