From f1e55b370f58929fa592328cc285c63dc2bb6034 Mon Sep 17 00:00:00 2001 From: Snider Date: Mon, 23 Feb 2026 07:43:48 +0000 Subject: [PATCH] fix: skip permission tests when running as root (CI/Docker) Co-Authored-By: Virgil --- jobrunner/coverage_boost_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jobrunner/coverage_boost_test.go b/jobrunner/coverage_boost_test.go index a1ea6dd..ea44256 100644 --- a/jobrunner/coverage_boost_test.go +++ b/jobrunner/coverage_boost_test.go @@ -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)