Skip to content

test(cli): build the permission hook binary with the real Go caches - #98

Open
vishr wants to merge 1 commit into
mainfrom
fix/hook-test-go-caches
Open

vishr wants to merge 1 commit into
mainfrom
fix/hook-test-go-caches

Conversation

@vishr

@vishr vishr commented Oct 31, 2026

Copy link
Copy Markdown
Member

TestPermissionHookBuiltBinary moved HOME to a temporary directory before
running go build. With GOPATH unset, go then downloaded every module into a
cache under that HOME, whose files are read-only, so the test failed at
cleanup ("TempDir RemoveAll cleanup: unlinkat ... permission denied") on
any machine without GOMODCACHE set, and took 25 seconds. CI sets the cache
paths, so it passed there.

The build now uses the module and build caches go reports before HOME
moves. The test passes locally in about 3 seconds.

TestPermissionHookBuiltBinary moved HOME to a temporary directory before
running go build. With GOPATH unset, go then downloaded every module into a
cache under that HOME, whose files are read-only, so the test failed at
cleanup ("TempDir RemoveAll cleanup: unlinkat ... permission denied") on
any machine without GOMODCACHE set, and took 25 seconds. CI sets the cache
paths, so it passed there.

The build now uses the module and build caches go reports before HOME
moves. The test passes locally in about 3 seconds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant