fix: skip permission tests when running as root (CI/Docker)
Some checks failed
Security Scan / security (push) Failing after 10s
Test / test (push) Successful in 4m55s

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-02-23 07:43:48 +00:00
parent f684a7f845
commit f1e55b370f

View file

@ -75,6 +75,9 @@ func TestSanitizePathComponent_Bad_Invalid(t *testing.T) {
// --- Journal: Append with readonly directory ---
func TestJournal_Append_Bad_ReadonlyDir(t *testing.T) {
if os.Getuid() == 0 {
t.Skip("chmod does not restrict root")
}
// Create a dir that we then make readonly (only works as non-root).
dir := t.TempDir()
readonlyDir := filepath.Join(dir, "readonly")
@ -328,6 +331,9 @@ func TestPoller_Run_Good_ImmediateCancel(t *testing.T) {
// --- Journal: Append with journal error logging ---
func TestPoller_RunOnce_Good_JournalAppendError(t *testing.T) {
if os.Getuid() == 0 {
t.Skip("chmod does not restrict root")
}
// Use a directory that will cause journal writes to fail.
dir := t.TempDir()
journal, err := NewJournal(dir)