test: skip unwritable dir test when running as root

Docker self-hosted runners run as root, which can write anywhere.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Snider 2026-02-02 22:04:16 +00:00
parent 5ee8d3f891
commit 69feabbba6

View file

@ -304,6 +304,9 @@ func TestConfig_SetProjectDir_Good(t *testing.T) {
func TestWriteConfig_Bad(t *testing.T) {
t.Run("returns error for unwritable directory", func(t *testing.T) {
if os.Geteuid() == 0 {
t.Skip("root can write to any directory")
}
dir := t.TempDir()
// Create .core directory and make it unwritable