ansh0014 commented on code in PR #6886:
URL: https://github.com/apache/camel-k/pull/6886#discussion_r4292231814


##########
pkg/cmd/source/util_test.go:
##########
@@ -42,34 +43,45 @@ func isWindows() bool {
        return runtime.GOOS == "windows"
 }
 
-func TestPermissionDenied(t *testing.T) {
-
+func denyAccess(t *testing.T, dir string) func() {
+       t.Helper()
        if isWindows() {
-               t.Skip("Test not reliably producing a result on a windows OS")
+               out, err := exec.Command("icacls", dir, "/deny", 
"*S-1-1-0:(OI)(CI)(F)").CombinedOutput()

Review Comment:
   Thanks @squakez ! I have updated the PR:
   - Removed `icacls` to keep the unit test pure Go, and updated the `t.Skip` 
comment with the Windows `os.Chmod` limitation.
   - Kept the business logic fix in `pkg/cmd/source/util.go` to properly report 
`fs.ErrPermission` on Windows.
   - Verified all tests in `pkg/cmd/source` pass on Windows.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to