ansh0014 commented on code in PR #6886:
URL: https://github.com/apache/camel-k/pull/6886#discussion_r4302672972
##########
pkg/cmd/source/util.go:
##########
@@ -33,6 +34,7 @@ const (
httpsScheme = "https"
)
+var stat = os.Stat // for testing purposes, we can override this function
Review Comment:
Understood , I'll remove `var stat` from `util.go` and keep the production
code clean.
Would it be acceptable to handle the permission setup in platform-specific
test files — using `os.Chmod` in `util_unix_test.go` and the Go
`golang.org/x/sys/windows` APIs in `util_windows_test.go` to configure the
directory's ACL?
This would avoid external CLI commands like `icacls` while keeping the test
logic shared and allowing us to test the permission-denied behavior on both
platforms.
Does this approach sound reasonable to you, or would you prefer a different
testing strategy?
--
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]