From 245fada966214a87abe8764b30035fd5a4ad1284 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 22 Oct 2026 03:38:36 -0700 Subject: [PATCH] fuse integration: resolve the weed binary to an absolute path The started processes run with cmd.Dir at the framework's temp dir, so a relative candidate like ../weed no longer resolves. Prefer PATH, then probe the usual build outputs and return absolute paths only. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- test/fuse_integration/framework.go | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/test/fuse_integration/framework.go b/test/fuse_integration/framework.go index 3a4490a1df..4505f8c1f7 100644 --- a/test/fuse_integration/framework.go +++ b/test/fuse_integration/framework.go @@ -395,23 +395,24 @@ func (f *FuseTestFramework) waitForMount(timeout time.Duration) error { return fmt.Errorf("mount point not ready within timeout") } -// findWeedBinary locates the weed binary +// findWeedBinary locates the weed binary. Candidates are resolved to +// absolute paths because the started processes run with cmd.Dir set to the +// framework's temp dir, where a relative path would not resolve. func findWeedBinary() string { - // Try different possible locations - candidates := []string{ - "./weed", - "../weed", - "../../weed", - "weed", // in PATH + if p, err := exec.LookPath("weed"); err == nil { + return p } + candidates := []string{ + "../../weed/weed", + "./weed", + "../weed", + } for _, candidate := range candidates { - if _, err := exec.LookPath(candidate); err == nil { - return candidate - } if info, err := os.Stat(candidate); err == nil && !info.IsDir() && info.Mode()&0111 != 0 { - abs, _ := filepath.Abs(candidate) - return abs + if abs, err := filepath.Abs(candidate); err == nil { + return abs + } } }