File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package migration
33import (
44 "os"
55 "path/filepath"
6+ "runtime"
67 "testing"
78)
89
@@ -101,8 +102,11 @@ exec "goenv" "$@"
101102 })
102103
103104 t .Run ("returns error when removal fails" , func (t * testing.T ) {
104- // This test is platform-dependent and may not work in all environments
105- // Skip if we can't create a read-only directory
105+ // Skip on Windows - Unix permission model doesn't apply
106+ if runtime .GOOS == "windows" {
107+ t .Skip ("Skipping permission test on Windows - different permission model" )
108+ }
109+
106110 shimPath := filepath .Join (shimsDir , "goenv" )
107111 v2Content := `#!/usr/bin/env bash
108112exec "/opt/homebrew/Cellar/goenv/2.2.38_1/libexec/goenv" "$@"
@@ -111,9 +115,9 @@ exec "/opt/homebrew/Cellar/goenv/2.2.38_1/libexec/goenv" "$@"
111115 t .Fatalf ("Failed to create shim: %v" , err )
112116 }
113117
114- // Make directory read-only (Unix-like systems)
118+ // Make directory read-only (Unix-like systems only )
115119 if err := os .Chmod (shimsDir , 0555 ); err != nil {
116- t .Skip ("Cannot test permission error on this platform" )
120+ t .Skipf ("Cannot test permission error: %v" , err )
117121 }
118122 defer os .Chmod (shimsDir , 0755 ) // Restore permissions
119123
You can’t perform that action at this time.
0 commit comments