From 04e110386331e40d31ac638f67dac808b9537bee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Mon, 11 May 2026 09:49:13 +0200 Subject: [PATCH] fix: re-download cached func CLI binary if not executable ensureFuncVersion() only checked if the cached binary file existed, not whether it had execute permission. If the binary lost its execute bit (e.g. due to a partial download or filesystem issue in CI), the test would fail with "permission denied" and cascade-fail other specs. --- test/utils/func.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/utils/func.go b/test/utils/func.go index be2e95e..6530533 100644 --- a/test/utils/func.go +++ b/test/utils/func.go @@ -187,9 +187,14 @@ func ensureFuncVersion(version string) (string, error) { versionDir := filepath.Join(projectDir, "bin", "func-cli", version) funcBinary := filepath.Join(versionDir, "func") - // Check if already cached - if _, err := os.Stat(funcBinary); err == nil { - return funcBinary, nil + // Check if already cached and executable + if info, err := os.Stat(funcBinary); err == nil { + isExecutable := info.Mode().Perm()&0o111 != 0 + if isExecutable { + return funcBinary, nil + } + // Binary exists but is not executable — remove and re-download + os.Remove(funcBinary) } // Download the version